From 57aa9bdf9a415301baa1b48655c90d8aa4fbf138 Mon Sep 17 00:00:00 2001 From: "f.albany" Date: Tue, 3 Nov 2026 17:16:53 +0100 Subject: [PATCH 1/5] feat(desktop): widen default window to 1200x700 for the status bar --- src/profiles/desktop/launcher.py | 4 ++-- tests/desktop/test_launcher.py | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/profiles/desktop/launcher.py b/src/profiles/desktop/launcher.py index 83f7ceb..219ff7c 100644 --- a/src/profiles/desktop/launcher.py +++ b/src/profiles/desktop/launcher.py @@ -96,9 +96,9 @@ def launch_desktop_window( webview.create_window( title=window_title, url=url, - width=1000, + width=1200, height=700, - min_size=(800, 500), + min_size=(1000, 500), ) webview.start(debug=debug) finally: diff --git a/tests/desktop/test_launcher.py b/tests/desktop/test_launcher.py index 71b9377..bc9afd6 100644 --- a/tests/desktop/test_launcher.py +++ b/tests/desktop/test_launcher.py @@ -57,3 +57,16 @@ def test_webview_url_and_single_line_for_loopback_bind( out = capsys.readouterr().out assert "Local:" in out assert "Network:" not in out + + +def test_webview_window_geometry_fits_status_bar(webview_mock: MagicMock) -> None: + """The default window is wide enough for the full status bar in one line.""" + launch_desktop_window( + AppConfig(title="t"), + port=find_available_port(8000), + host=_LOOPBACK_HOST, + ) + kwargs = webview_mock.create_window.call_args.kwargs + assert kwargs["width"] == 1200 + assert kwargs["height"] == 700 + assert kwargs["min_size"] == (1000, 500) From ec5a94bf54878b786be5fcd3be8181903a1f428e Mon Sep 17 00:00:00 2001 From: "f.albany" Date: Tue, 3 Nov 2026 17:16:55 +0100 Subject: [PATCH 2/5] feat(telemetry): web client reconnect/disconnect events with idle sweep --- docs/operations/log-format.md | 8 +++ src/profiles/core/telemetry/events.py | 20 +++++++ src/profiles/server/app.py | 80 ++++++++++++++++++++++++--- tests/core/telemetry/test_events.py | 56 +++++++++++++++++++ tests/server/test_app.py | 45 ++++++++++++++- 5 files changed, 200 insertions(+), 9 deletions(-) diff --git a/docs/operations/log-format.md b/docs/operations/log-format.md index dba0a06..0f8b801 100644 --- a/docs/operations/log-format.md +++ b/docs/operations/log-format.md @@ -62,6 +62,9 @@ Every line follows this shape: | `FILTER_REJECTED` | Right-click → Filter pre-check failed | `kind`, `reason`, `value` | | `HASH_COMPUTED` | Right-click → Hash computed | `algorithm`, `path`, `status`, `duration_ms`, `error`, `reason` | | `HASH_VERIFIED` | Right-click → Hash verified against clipboard | `algorithm`, `path`, `match`, `status`, `reason`, `error` | +| `WEB_CLIENT` | Web UI client connected / reconnected after an idle gap / disconnected after going silent (dedup per client IP; idle threshold 120 s) | `event` (`connected` / `reconnected` / `disconnected`), `ip`, `path`, `ua`, `idle_s` | +| `BIND_CHANGED` | Server rebound between LAN exposure and loopback (status-bar LAN toggle) | `host`, `lan` | +| `BIND_CHANGE_FAILED` | Rebind request failed; the server reverted to the previous address | `host`, `error` | ## Examples @@ -106,6 +109,11 @@ grep 'SCAN_METRICS' profiles.log | awk -F'duration_ms=' '{print $2}' | sort -nr grep 'FILE_LAUNCHED' profiles.log ``` +**Client connections (who opened the web UI):** +```bash +grep 'WEB_CLIENT' profiles.log +``` + **All right-click filter changes:** ```bash grep 'FILTER_CHANGED' profiles.log diff --git a/src/profiles/core/telemetry/events.py b/src/profiles/core/telemetry/events.py index 14b419c..3aace9a 100644 --- a/src/profiles/core/telemetry/events.py +++ b/src/profiles/core/telemetry/events.py @@ -88,6 +88,26 @@ def web_client(logger: logging.Logger, *, ip: str, path: str, user_agent: str = logger.info("WEB_CLIENT %s", " ".join(parts)) +def web_client_reconnected(logger: logging.Logger, *, ip: str, path: str) -> None: + """Emit WEB_CLIENT — a known client came back after the idle-disconnect window.""" + logger.info('WEB_CLIENT event="reconnected" ip="%s" path=%s', ip, _quote(path)) + + +def web_client_left(logger: logging.Logger, *, ip: str, idle_s: int) -> None: + """Emit WEB_CLIENT — a client stopped polling and is considered gone.""" + logger.info('WEB_CLIENT event="disconnected" ip="%s" idle_s=%d', ip, idle_s) + + +def bind_changed(logger: logging.Logger, *, host: str, lan: bool) -> None: + """Emit BIND_CHANGED — the server rebound between LAN exposure and loopback.""" + logger.info('BIND_CHANGED host="%s" lan=%s', host, "true" if lan else "false") + + +def bind_change_failed(logger: logging.Logger, *, host: str, error: str) -> None: + """Emit BIND_CHANGE_FAILED — a rebind failed and the server reverted.""" + logger.warning('BIND_CHANGE_FAILED host="%s" error="%s"', host, error) + + def app_restarting(logger: logging.Logger) -> None: """Emit APP_RESTARTING.""" logger.info("APP_RESTARTING") diff --git a/src/profiles/server/app.py b/src/profiles/server/app.py index eeca0bc..069a11b 100644 --- a/src/profiles/server/app.py +++ b/src/profiles/server/app.py @@ -2,10 +2,14 @@ from __future__ import annotations +import asyncio import logging +import time +from collections.abc import AsyncIterator, Awaitable, Callable +from contextlib import asynccontextmanager, suppress from pathlib import Path -from fastapi import FastAPI, Request +from fastapi import FastAPI, Request, Response from fastapi.middleware.cors import CORSMiddleware from profiles.core.telemetry import events @@ -22,6 +26,60 @@ # Server-side telemetry logger (the "profiles" logger writes profiles.log). _LOGGER = logging.getLogger("profiles") +# A client counts as gone once it has not sent a request for this long. The +# web UI polls /api/notifications every 4s in the foreground, but browsers +# throttle background tabs down to ~60s, so the threshold must sit above +# that to avoid disconnect/reconnect churn for merely-hidden tabs. +CLIENT_IDLE_DISCONNECT_S = 120.0 + +# How often the lifespan watchdog looks for clients past the idle threshold. +CLIENT_SWEEP_INTERVAL_S = 15.0 + + +def sweep_disconnected_clients( + last_seen: dict[str, float], + now: float, + logger: logging.Logger, + timeout_s: float = CLIENT_IDLE_DISCONNECT_S, +) -> None: + """Log and drop clients idle for more than ``timeout_s``. + + Pure bookkeeping over the ``ip -> last-seen`` map: mutates ``last_seen`` + in place and emits one ``WEB_CLIENT event="disconnected"`` per stale + entry. Called periodically by the app lifespan and directly by tests. + + Args: + last_seen: Client IP to last-request monotonic timestamp map. + now: Current ``time.monotonic()`` value. + logger: Application logger receiving the events. + timeout_s: Idle duration after which a client counts as gone. + """ + for ip, seen_at in list(last_seen.items()): + idle_s = now - seen_at + if idle_s > timeout_s: + del last_seen[ip] + events.web_client_left(logger, ip=ip, idle_s=int(idle_s)) + + +async def _sweep_loop(app: FastAPI) -> None: + """Periodically sweep the client map until the task is cancelled.""" + last_seen: dict[str, float] = app.state.client_last_seen + while True: + await asyncio.sleep(CLIENT_SWEEP_INTERVAL_S) + sweep_disconnected_clients(last_seen, time.monotonic(), _LOGGER) + + +@asynccontextmanager +async def _client_watchdog_lifespan(app: FastAPI) -> AsyncIterator[None]: + """Run the disconnect watchdog for the server's lifetime.""" + task = asyncio.create_task(_sweep_loop(app)) + try: + yield + finally: + task.cancel() + with suppress(asyncio.CancelledError): + await task + def create_app(state: ServerState, static_dir: Path | None = None) -> FastAPI: """Create and configure the FastAPI application. @@ -33,9 +91,9 @@ def create_app(state: ServerState, static_dir: Path | None = None) -> FastAPI: Returns: Configured FastAPI instance. """ - app = FastAPI(title="ProFiles API", version="1.0.0") + app = FastAPI(title="ProFiles API", version="1.0.0", lifespan=_client_watchdog_lifespan) app.state.server_state = state - app.state.seen_client_ips: set[str] = set() + app.state.client_last_seen: dict[str, float] = {} app.add_middleware( CORSMiddleware, @@ -46,18 +104,24 @@ def create_app(state: ServerState, static_dir: Path | None = None) -> FastAPI: ) @app.middleware("http") - async def log_web_client(request: Request, call_next): # type: ignore[no-untyped-def] - """Emit WEB_CLIENT once per client IP (first request from it).""" + async def log_web_client( + request: Request, call_next: Callable[[Request], Awaitable[Response]] + ) -> Response: + """Emit WEB_CLIENT on first connect or reconnect after a long idle.""" client_ip = request.client.host if request.client else "unknown" - seen: set[str] = request.app.state.seen_client_ips - if client_ip not in seen: - seen.add(client_ip) + last_seen: dict[str, float] = request.app.state.client_last_seen + now = time.monotonic() + previous = last_seen.get(client_ip) + if previous is None: events.web_client( _LOGGER, ip=client_ip, path=request.url.path, user_agent=request.headers.get("user-agent", "")[:120], ) + elif now - previous > CLIENT_IDLE_DISCONNECT_S: + events.web_client_reconnected(_LOGGER, ip=client_ip, path=request.url.path) + last_seen[client_ip] = now return await call_next(request) app.include_router(system_router) diff --git a/tests/core/telemetry/test_events.py b/tests/core/telemetry/test_events.py index 01fab67..e572449 100644 --- a/tests/core/telemetry/test_events.py +++ b/tests/core/telemetry/test_events.py @@ -13,6 +13,7 @@ app_launched, app_restarting, app_started, + bind_changed, command_exit, command_failed, command_output, @@ -43,6 +44,9 @@ scan_failed, theme_switched, wcag_contrast_faint, + web_client, + web_client_left, + web_client_reconnected, workflow_aborted, workflow_step, workflow_step_failed, @@ -689,3 +693,55 @@ def test_rejected_empty_clipboard(self, caplog: pytest.LogCaptureFixture) -> Non 'HASH_VERIFIED algorithm="md5" path=/a.zip status="rejected" reason="empty_clipboard"' in caplog.text ) + + +# --------------------------------------------------------------------------- +# Web client & bind telemetry +# --------------------------------------------------------------------------- + + +class TestWebClientEvents: + def test_connected_with_user_agent(self, caplog: pytest.LogCaptureFixture) -> None: + logger = logging.getLogger("test_web_client_ua") + with caplog.at_level(logging.INFO, logger=logger.name): + web_client(logger, ip="192.168.1.50", path="/api/system", user_agent="Mozilla/5.0") + assert ( + 'WEB_CLIENT event="connected" ip="192.168.1.50" path=/api/system ua="Mozilla/5.0"' + in caplog.text + ) + + def test_connected_without_user_agent(self, caplog: pytest.LogCaptureFixture) -> None: + logger = logging.getLogger("test_web_client_noua") + with caplog.at_level(logging.INFO, logger=logger.name): + web_client(logger, ip="192.168.1.50", path="/api/system") + assert 'WEB_CLIENT event="connected" ip="192.168.1.50" path=/api/system' in caplog.text + assert "ua=" not in caplog.text + + def test_reconnected(self, caplog: pytest.LogCaptureFixture) -> None: + logger = logging.getLogger("test_web_client_reconnected") + with caplog.at_level(logging.INFO, logger=logger.name): + web_client_reconnected(logger, ip="192.168.1.50", path="/api/notifications") + assert ( + 'WEB_CLIENT event="reconnected" ip="192.168.1.50" path=/api/notifications' + in caplog.text + ) + + def test_left(self, caplog: pytest.LogCaptureFixture) -> None: + logger = logging.getLogger("test_web_client_left") + with caplog.at_level(logging.INFO, logger=logger.name): + web_client_left(logger, ip="192.168.1.50", idle_s=135) + assert 'WEB_CLIENT event="disconnected" ip="192.168.1.50" idle_s=135' in caplog.text + + +class TestBindChanged: + def test_lan_on(self, caplog: pytest.LogCaptureFixture) -> None: + logger = logging.getLogger("test_bind_lan") + with caplog.at_level(logging.INFO, logger=logger.name): + bind_changed(logger, host="0.0.0.0", lan=True) + assert 'BIND_CHANGED host="0.0.0.0" lan=true' in caplog.text + + def test_lan_off(self, caplog: pytest.LogCaptureFixture) -> None: + logger = logging.getLogger("test_bind_loopback") + with caplog.at_level(logging.INFO, logger=logger.name): + bind_changed(logger, host="127.0.0.1", lan=False) + assert 'BIND_CHANGED host="127.0.0.1" lan=false' in caplog.text diff --git a/tests/server/test_app.py b/tests/server/test_app.py index 532a9e4..e7f83b4 100644 --- a/tests/server/test_app.py +++ b/tests/server/test_app.py @@ -3,12 +3,17 @@ from __future__ import annotations import logging +import time import httpx import pytest from profiles.core.config.models import AppConfig -from profiles.server.app import create_app +from profiles.server.app import ( + CLIENT_IDLE_DISCONNECT_S, + create_app, + sweep_disconnected_clients, +) from profiles.server.state import ServerState @@ -54,3 +59,41 @@ async def test_web_client_logged_once_per_ip( assert first_count == 1 assert second_count == 1 + + +@pytest.mark.anyio +async def test_web_client_reconnected_after_idle_gap( + app_state: ServerState, caplog: pytest.LogCaptureFixture +) -> None: + """A client silent for longer than the idle threshold logs reconnected.""" + app = create_app(app_state) + + async with httpx.AsyncClient( + transport=httpx.ASGITransport(app=app), base_url="http://test" + ) as client: + with caplog.at_level(logging.INFO, logger="profiles"): + await client.get("/api/system") + ip = next(iter(app.state.client_last_seen)) + app.state.client_last_seen[ip] -= CLIENT_IDLE_DISCONNECT_S + 30.0 + await client.get("/api/notifications") + + messages = [r.message for r in caplog.records if "WEB_CLIENT" in r.message] + assert sum('event="connected"' in m for m in messages) == 1 + assert any('event="reconnected"' in m for m in messages) + + +def test_sweep_disconnected_clients_logs_and_drops_stale( + caplog: pytest.LogCaptureFixture, +) -> None: + """Entries past the idle threshold are logged and removed; fresh ones stay.""" + logger = logging.getLogger("test_sweep_clients") + now = time.monotonic() + last_seen = {"10.0.0.1": now - 300.0, "10.0.0.2": now - 5.0} + + with caplog.at_level(logging.INFO, logger=logger.name): + sweep_disconnected_clients(last_seen, now, logger) + + assert "10.0.0.1" not in last_seen + assert "10.0.0.2" in last_seen + assert 'WEB_CLIENT event="disconnected" ip="10.0.0.1" idle_s=300' in caplog.text + assert "10.0.0.2" not in caplog.text From e227bd9a3f198e5489f3289fe1d0b20614820846 Mon Sep 17 00:00:00 2001 From: "f.albany" Date: Tue, 3 Nov 2026 17:16:58 +0100 Subject: [PATCH 3/5] fix(server): run LAN rebind off the serving thread MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bind route handler runs on the uvicorn thread, so a synchronous rebind() had stop() join the current thread (RuntimeError) — and a server cannot release its port while still serving the request that asked for the rebind. The route now answers 'rebinding' immediately and a worker thread performs the rebind after the response, emitting BIND_CHANGED / BIND_CHANGE_FAILED. The UI polls /api/system for the actual outcome instead of trusting an instant refetch. --- src/profiles/server/routes/system.py | 69 +++++-- .../{index-C-z6GSZn.js => index-B7u9N9je.js} | 184 +++++++++--------- src/profiles/web/dist/index.html | 2 +- src/profiles/web/dist/sw.js | 2 +- src/profiles/web/src/App.tsx | 23 ++- src/profiles/web/src/api/client.ts | 32 ++- tests/desktop/test_lifecycle.py | 38 ++++ tests/server/routes/test_system.py | 75 ++++++- 8 files changed, 306 insertions(+), 119 deletions(-) rename src/profiles/web/dist/assets/{index-C-z6GSZn.js => index-B7u9N9je.js} (85%) diff --git a/src/profiles/server/routes/system.py b/src/profiles/server/routes/system.py index 3f99cd0..6853ad9 100644 --- a/src/profiles/server/routes/system.py +++ b/src/profiles/server/routes/system.py @@ -2,14 +2,26 @@ from __future__ import annotations +import logging import platform +import threading +import time from fastapi import APIRouter, HTTPException, Request from pydantic import BaseModel from profiles.core.environment import system +from profiles.core.telemetry import events from profiles.server.state import BindableServer +# Telemetry logger (the "profiles" logger writes profiles.log). +_LOGGER = logging.getLogger("profiles") + +# Grace period so the HTTP response is fully flushed before the rebind +# worker starts shutting the old server down. Without it, the response +# could race the listener close and the client would see a reset socket. +_REBIND_DRAIN_WAIT_S = 0.25 + router = APIRouter(prefix="/api", tags=["system"]) @@ -49,18 +61,16 @@ async def system_info(request: Request) -> dict[str, object]: } -@router.post("/system/bind") -async def bind_server(payload: BindRequest, request: Request) -> dict[str, object]: - """Rebind the running server between LAN exposure and loopback-only. +def _rebind_worker(server: BindableServer, target_host: str) -> None: + """Run the rebind off the serving thread and log the outcome. - Transient on purpose: the choice resets to the launch default on the - next restart. The desktop lifecycle reverts a failed bind, so on error - the reported state is still the previous one. + The route handler runs on the uvicorn thread, so a synchronous rebind + would have ``stop()`` join the *current* thread (RuntimeError) — and a + server cannot release its port while still serving the very request + that asked for the rebind. This worker therefore runs strictly after + the HTTP response has been sent. """ - server = _background_server(request) - if server is None: - raise HTTPException(status_code=503, detail="no running server to rebind") - target_host = "0.0.0.0" if payload.lan else "127.0.0.1" + time.sleep(_REBIND_DRAIN_WAIT_S) # Lazy import: desktop.lifecycle imports server.app at module level, so a # top-level import here would create an import cycle. from profiles.desktop.lifecycle import ServerStartError @@ -68,5 +78,40 @@ async def bind_server(payload: BindRequest, request: Request) -> dict[str, objec try: server.rebind(target_host) except ServerStartError as exc: - raise HTTPException(status_code=500, detail=str(exc)) from exc - return {"host": server.host, "lan_enabled": payload.lan} + events.bind_change_failed(_LOGGER, host=target_host, error=str(exc)) + else: + events.bind_changed(_LOGGER, host=server.host, lan=target_host == "0.0.0.0") + + +def _schedule_rebind(server: BindableServer, target_host: str) -> threading.Thread: + """Start the rebind on a daemon thread; returns it so tests can join.""" + worker = threading.Thread( + target=_rebind_worker, + args=(server, target_host), + name="profiles-rebind", + daemon=True, + ) + worker.start() + return worker + + +@router.post("/system/bind") +async def bind_server(payload: BindRequest, request: Request) -> dict[str, object]: + """Rebind the running server between LAN exposure and loopback-only. + + Asynchronous on purpose: the response is sent before the old server + shuts down (a server cannot release its port while serving the request + that asked for the rebind). The actual rebind runs on a worker thread + and the client observes the outcome through ``GET /api/system`` — + including a failed rebind, which reverts to the previous host. + """ + server = _background_server(request) + if server is None: + raise HTTPException(status_code=503, detail="no running server to rebind") + target_host = "0.0.0.0" if payload.lan else "127.0.0.1" + _schedule_rebind(server, target_host) + return { + "host": target_host, + "lan_enabled": payload.lan, + "status": "rebinding", + } diff --git a/src/profiles/web/dist/assets/index-C-z6GSZn.js b/src/profiles/web/dist/assets/index-B7u9N9je.js similarity index 85% rename from src/profiles/web/dist/assets/index-C-z6GSZn.js rename to src/profiles/web/dist/assets/index-B7u9N9je.js index fb4db06..8b37d30 100644 --- a/src/profiles/web/dist/assets/index-C-z6GSZn.js +++ b/src/profiles/web/dist/assets/index-B7u9N9je.js @@ -14,7 +14,7 @@ var Xv=Object.defineProperty;var Iv=(n,r,a)=>r in n?Xv(n,r,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var px;function $v(){if(px)return ze;px=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),w=Symbol.for("react.view_transition"),v=Symbol.iterator;function S(E){return E===null||typeof E!="object"?null:(E=v&&E[v]||E["@@iterator"],typeof E=="function"?E:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},L=Object.assign,z={};function $(E,Y,oe){this.props=E,this.context=Y,this.refs=z,this.updater=oe||C}$.prototype.isReactComponent={},$.prototype.setState=function(E,Y){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,Y,"setState")},$.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function I(){}I.prototype=$.prototype;function J(E,Y,oe){this.props=E,this.context=Y,this.refs=z,this.updater=oe||C}var ie=J.prototype=new I;ie.constructor=J,L(ie,$.prototype),ie.isPureReactComponent=!0;var U=Array.isArray;function R(){}var Q={H:null,A:null,T:null,S:null},fe=Object.prototype.hasOwnProperty;function B(E,Y,oe){var de=oe.ref;return{$$typeof:n,type:E,key:Y,ref:de!==void 0?de:null,props:oe}}function ne(E,Y){return B(E.type,Y,E.props)}function V(E){return typeof E=="object"&&E!==null&&E.$$typeof===n}function se(E){var Y={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(oe){return Y[oe]})}var ve=/\/+/g;function ae(E,Y){return typeof E=="object"&&E!==null&&E.key!=null?se(""+E.key):Y.toString(36)}function A(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(R,R):(E.status="pending",E.then(function(Y){E.status==="pending"&&(E.status="fulfilled",E.value=Y)},function(Y){E.status==="pending"&&(E.status="rejected",E.reason=Y)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function W(E,Y,oe,de,je){var ye=typeof E;(ye==="undefined"||ye==="boolean")&&(E=null);var _e=!1;if(E===null)_e=!0;else switch(ye){case"bigint":case"string":case"number":_e=!0;break;case"object":switch(E.$$typeof){case n:case r:_e=!0;break;case y:return _e=E._init,W(_e(E._payload),Y,oe,de,je)}}if(_e)return je=je(E),_e=de===""?"."+ae(E,0):de,U(je)?(oe="",_e!=null&&(oe=_e.replace(ve,"$&/")+"/"),W(je,Y,oe,"",function(Rt){return Rt})):je!=null&&(V(je)&&(je=ne(je,oe+(je.key==null||E&&E.key===je.key?"":(""+je.key).replace(ve,"$&/")+"/")+_e)),Y.push(je)),1;_e=0;var pe=de===""?".":de+":";if(U(E))for(var Se=0;Ser in n?Xv(n,r,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var xx;function Pv(){return xx||(xx=1,(function(n){function r(A,W){var le=A.length;A.push(W);e:for(;0>>1,N=A[re];if(0>>1;res(M,le))Es(Y,M)?(A[re]=Y,A[E]=le,re=E):(A[re]=M,A[Ge]=le,re=Ge);else if(Es(Y,le))A[re]=Y,A[E]=le,re=E;else break e}}return W}function s(A,W){var le=A.sortIndex-W.sortIndex;return le!==0?le:A.id-W.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var f=Date,m=f.now();n.unstable_now=function(){return f.now()-m}}var p=[],x=[],y=1,g=null,w=3,v=!1,S=!1,C=!1,L=!1,z=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function J(A){for(var W=a(x);W!==null;){if(W.callback===null)u(x);else if(W.startTime<=A)u(x),W.sortIndex=W.expirationTime,r(p,W);else break;W=a(x)}}function ie(A){if(C=!1,J(A),!S)if(a(p)!==null)S=!0,U||(U=!0,V());else{var W=a(x);W!==null&&ae(ie,W.startTime-A)}}var U=!1,R=-1,Q=5,fe=-1;function B(){return L?!0:!(n.unstable_now()-feA&&B());){var re=g.callback;if(typeof re=="function"){g.callback=null,w=g.priorityLevel;var N=re(g.expirationTime<=A);if(A=n.unstable_now(),typeof N=="function"){g.callback=N,J(A),W=!0;break t}g===a(p)&&u(p),J(A)}else u(p);g=a(p)}if(g!==null)W=!0;else{var qe=a(x);qe!==null&&ae(ie,qe.startTime-A),W=!1}}break e}finally{g=null,w=le,v=!1}W=void 0}}finally{W?V():U=!1}}}var V;if(typeof I=="function")V=function(){I(ne)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,ve=se.port2;se.port1.onmessage=ne,V=function(){ve.postMessage(null)}}else V=function(){z(ne,0)};function ae(A,W){R=z(function(){A(n.unstable_now())},W)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(A){A.callback=null},n.unstable_forceFrameRate=function(A){0>A||125re?(A.sortIndex=le,r(x,A),a(p)===null&&A===a(x)&&(C?($(R),R=-1):C=!0,ae(ie,le-re))):(A.sortIndex=N,r(p,A),S||v||(S=!0,U||(U=!0,V()))),A},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(A){var W=w;return function(){var le=w;w=W;try{return A.apply(this,arguments)}finally{w=le}}}})($f)),$f}var yx;function Wv(){return yx||(yx=1,Zf.exports=Pv()),Zf.exports}var Jf={exports:{}},Jt={};/** + */var xx;function Pv(){return xx||(xx=1,(function(n){function r(A,W){var le=A.length;A.push(W);e:for(;0>>1,N=A[re];if(0>>1;res(M,le))Es(Y,M)?(A[re]=Y,A[E]=le,re=E):(A[re]=M,A[Ge]=le,re=Ge);else if(Es(Y,le))A[re]=Y,A[E]=le,re=E;else break e}}return W}function s(A,W){var le=A.sortIndex-W.sortIndex;return le!==0?le:A.id-W.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var f=Date,m=f.now();n.unstable_now=function(){return f.now()-m}}var p=[],x=[],y=1,g=null,w=3,v=!1,S=!1,T=!1,L=!1,D=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function J(A){for(var W=a(x);W!==null;){if(W.callback===null)u(x);else if(W.startTime<=A)u(x),W.sortIndex=W.expirationTime,r(p,W);else break;W=a(x)}}function ie(A){if(T=!1,J(A),!S)if(a(p)!==null)S=!0,U||(U=!0,V());else{var W=a(x);W!==null&&ae(ie,W.startTime-A)}}var U=!1,R=-1,Q=5,fe=-1;function B(){return L?!0:!(n.unstable_now()-feA&&B());){var re=g.callback;if(typeof re=="function"){g.callback=null,w=g.priorityLevel;var N=re(g.expirationTime<=A);if(A=n.unstable_now(),typeof N=="function"){g.callback=N,J(A),W=!0;break t}g===a(p)&&u(p),J(A)}else u(p);g=a(p)}if(g!==null)W=!0;else{var qe=a(x);qe!==null&&ae(ie,qe.startTime-A),W=!1}}break e}finally{g=null,w=le,v=!1}W=void 0}}finally{W?V():U=!1}}}var V;if(typeof I=="function")V=function(){I(ne)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,ve=se.port2;se.port1.onmessage=ne,V=function(){ve.postMessage(null)}}else V=function(){D(ne,0)};function ae(A,W){R=D(function(){A(n.unstable_now())},W)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(A){A.callback=null},n.unstable_forceFrameRate=function(A){0>A||125re?(A.sortIndex=le,r(x,A),a(p)===null&&A===a(x)&&(T?($(R),R=-1):T=!0,ae(ie,le-re))):(A.sortIndex=N,r(p,A),S||v||(S=!0,U||(U=!0,V()))),A},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(A){var W=w;return function(){var le=w;w=W;try{return A.apply(this,arguments)}finally{w=le}}}})($f)),$f}var yx;function Wv(){return yx||(yx=1,Zf.exports=Pv()),Zf.exports}var Jf={exports:{}},Jt={};/** * @license React * react-dom.production.js * @@ -30,7 +30,7 @@ var Xv=Object.defineProperty;var Iv=(n,r,a)=>r in n?Xv(n,r,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var bx;function e2(){if(bx)return Jt;bx=1;var n=qd();function r(y){var g="https://react.dev/errors/"+y;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Jf.exports=e2(),Jf.exports}/** + */var bx;function e2(){if(bx)return Jt;bx=1;var n=qd();function r(y){var g="https://react.dev/errors/"+y;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Jf.exports=e2(),Jf.exports}/** * @license React * react-dom-client.production.js * @@ -38,354 +38,354 @@ var Xv=Object.defineProperty;var Iv=(n,r,a)=>r in n?Xv(n,r,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var wx;function t2(){if(wx)return Ja;wx=1;var n=Wv(),r=qd(),a=Vy();function u(e){var t="https://react.dev/errors/"+e;if(1Gt||(e.current=Bt[Gt],Bt[Gt]=null,Gt--)}function Je(e,t){Gt++,Bt[Gt]=e.current,e.current=t}var en=St(null),bn=St(null),tn=St(null),Ht=St(null);function ge(e,t){switch(Je(tn,t),Je(bn,e),Je(en,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?kg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=kg(t),e=Sg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}nt(en),Je(en,e)}function Me(){nt(en),nt(bn),nt(tn)}function Le(e){var t=e.memoizedState;t!==null&&(Gr._currentValue=t.memoizedState,Je(Ht,e)),t=en.current;var l=Sg(t,e.type);t!==l&&(Je(bn,e),Je(en,l))}function lt(e){bn.current===e&&(nt(en),nt(bn)),Ht.current===e&&(nt(Ht),Gr._currentValue=Rt)}var K,ue;function ke(e){if(K===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);K=t&&t[1]||"",ue=-1Gt||(e.current=Bt[Gt],Bt[Gt]=null,Gt--)}function Je(e,t){Gt++,Bt[Gt]=e.current,e.current=t}var en=St(null),bn=St(null),tn=St(null),Ht=St(null);function ge(e,t){switch(Je(tn,t),Je(bn,e),Je(en,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?kg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=kg(t),e=Sg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}nt(en),Je(en,e)}function Me(){nt(en),nt(bn),nt(tn)}function Le(e){var t=e.memoizedState;t!==null&&(Gr._currentValue=t.memoizedState,Je(Ht,e)),t=en.current;var l=Sg(t,e.type);t!==l&&(Je(bn,e),Je(en,l))}function lt(e){bn.current===e&&(nt(en),nt(bn)),Ht.current===e&&(nt(Ht),Gr._currentValue=Rt)}var K,ue;function ke(e){if(K===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);K=t&&t[1]||"",ue=-1)":-1o||j[i]!==F[o]){var Z=` `+j[i].replace(" at new "," at ");return e.displayName&&Z.includes("")&&(Z=Z.replace("",e.displayName)),Z}while(1<=i&&0<=o);break}}}finally{Ce=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?ke(l):""}function it(e,t){switch(e.tag){case 26:case 27:case 5:return ke(e.type);case 16:return ke("Lazy");case 13:return e.child!==t&&t!==null?ke("Suspense Fallback"):ke("Suspense");case 19:return ke("SuspenseList");case 0:case 15:return ft(e.type,!1);case 11:return ft(e.type.render,!1);case 1:return ft(e.type,!0);case 31:return ke("Activity");case 30:return ke("ViewTransition");default:return""}}function Tt(e){try{var t="",l=null;do t+=it(e,l),l=e,e=e.return;while(e);return t}catch(i){return` Error generating stack: `+i.message+` -`+i.stack}}var nn=Object.prototype.hasOwnProperty,zn=n.unstable_scheduleCallback,Dn=n.unstable_cancelCallback,Mn=n.unstable_shouldYield,ll=n.unstable_requestPaint,Nt=n.unstable_now,Et=n.unstable_getCurrentPriorityLevel,Gn=n.unstable_ImmediatePriority,Qt=n.unstable_UserBlockingPriority,il=n.unstable_NormalPriority,he=n.unstable_LowPriority,fu=n.unstable_IdlePriority,xs=n.log,vn=n.unstable_setDisableYieldValue,pt=null,gt=null;function jt(e){if(typeof xs=="function"&&vn(e),gt&&typeof gt.setStrictMode=="function")try{gt.setStrictMode(pt,e)}catch{}}var Ke=Math.clz32?Math.clz32:On,ys=Math.log,du=Math.LN2;function On(e){return e>>>=0,e===0?32:31-(ys(e)/du|0)|0}var lr=256,Si=262144,ql=4194304;function wl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ir(e,t,l){var i=e.pendingLanes;if(i===0)return 0;var o=0,c=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var k=i&134217727;return k!==0?(i=k&~c,i!==0?o=wl(i):(b&=k,b!==0?o=wl(b):l||(l=k&~e,l!==0&&(o=wl(l))))):(k=i&~c,k!==0?o=wl(k):b!==0?o=wl(b):l||(l=i&~e,l!==0&&(o=wl(l)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,l=t&-t,c>=l||c===32&&(l&4194048)!==0)?t:o}function kl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ni(e,t){(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0l;l++)t.push(e);return t}function Fl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function bs(e,t,l,i,o,c){var b=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var k=e.entanglements,j=e.expirationTimes,F=e.hiddenUpdates;for(l=b&~l;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cs=!1;if(jl)try{var sa={};Object.defineProperty(sa,"passive",{get:function(){Cs=!0}}),window.addEventListener("test",sa,sa),window.removeEventListener("test",sa,sa)}catch{Cs=!1}var Xl=null,Ts=null,Nu=null;function yh(){if(Nu)return Nu;var e,t=Ts,l=t.length,i,o="value"in Xl?Xl.value:Xl.textContent,c=o.length;for(e=0;e=da),Nh=" ",Eh=!1;function jh(e,t){switch(e){case"keyup":return Y0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ch(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var dr=!1;function Q0(e,t){switch(e){case"compositionend":return Ch(t);case"keypress":return t.which!==32?null:(Eh=!0,Nh);case"textInput":return e=t.data,e===Nh&&Eh?null:e;default:return null}}function X0(e,t){if(dr)return e==="compositionend"||!Ms&&jh(e,t)?(e=yh(),Nu=Ts=Xl=null,dr=!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"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Rh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lh(e,t){var l=Rh(e);e=0;for(var i;l;){if(l.nodeType===3){if(i=e+l.textContent.length,e<=t&&i>=t)return{node:l,offset:t-e};e=i}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Rh(l)}}function Uh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Uh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Bh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ls(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=Ls(e.document)}return t}function Us(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var e1=jl&&"documentMode"in document&&11>=document.documentMode,hr=null,Bs=null,ga=null,Hs=!1;function Hh(e,t,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Hs||hr==null||hr!==Ls(i)||(i=hr,"selectionStart"in i&&Us(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),ga&&pa(ga,i)||(ga=i,i=Ao(Bs,"onSelect"),0>=b,o-=b,ol=1<<32-Ke(t)+o|l<Ae?(Mt=Ne,Ne=null):Mt=Ne.sibling;var We=H(q,Ne,G[Ae],ee);if(We===null){Ne===null&&(Ne=Mt);break}e&&Ne&&We.alternate===null&&t(q,Ne),O=c(We,O,Ae),$e===null?xe=We:$e.sibling=We,$e=We,Ne=Mt}if(Ae===G.length)return l(q,Ne),Fe&&Al(q,Ae),xe;if(Ne===null){for(;AeAe?(Mt=Ne,Ne=null):Mt=Ne.sibling;var xi=H(q,Ne,We.value,ee);if(xi===null){Ne===null&&(Ne=Mt);break}e&&Ne&&xi.alternate===null&&t(q,Ne),O=c(xi,O,Ae),$e===null?xe=xi:$e.sibling=xi,$e=xi,Ne=Mt}if(We.done)return l(q,Ne),Fe&&Al(q,Ae),xe;if(Ne===null){for(;!We.done;Ae++,We=G.next())We=te(q,We.value,ee),We!==null&&(O=c(We,O,Ae),$e===null?xe=We:$e.sibling=We,$e=We);return Fe&&Al(q,Ae),xe}for(Ne=i(Ne);!We.done;Ae++,We=G.next())We=X(Ne,q,Ae,We.value,ee),We!==null&&(e&&(Mt=We.alternate,Mt!==null&&Ne.delete(Mt.key===null?Ae:Mt.key)),O=c(We,O,Ae),$e===null?xe=We:$e.sibling=We,$e=We);return e&&Ne.forEach(function(Qv){return t(q,Qv)}),Fe&&Al(q,Ae),xe}function Be(q,O,G,ee){if(typeof G=="object"&&G!==null&&G.type===ne&&G.key===null&&G.props.ref===void 0&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case fe:e:{for(var xe=G.key;O!==null;){if(O.key===xe){if(xe=G.type,xe===ne){if(O.tag===7){l(q,O.sibling),ee=o(O,G.props.children),Pl(ee,G),ee.return=q,q=ee;break e}}else if(O.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===N&&Bi(xe)===O.type){l(q,O.sibling),ee=o(O,G.props),Pl(ee,G),ee.return=q,q=ee;break e}l(q,O);break}else t(q,O);O=O.sibling}G.type===ne?(ee=zi(G.props.children,q.mode,ee,G.key),Pl(ee,G),ee.return=q,q=ee):(ee=Ou(G.type,G.key,G.props,null,q.mode,ee),Pl(ee,G),ee.return=q,q=ee)}return b(q);case B:e:{for(xe=G.key;O!==null;){if(O.key===xe)if(O.tag===4&&O.stateNode.containerInfo===G.containerInfo&&O.stateNode.implementation===G.implementation){l(q,O.sibling),ee=o(O,G.children||[]),ee.return=q,q=ee;break e}else{l(q,O);break}else t(q,O);O=O.sibling}ee=Xs(G,q.mode,ee),ee.return=q,q=ee}return b(q);case N:return G=Bi(G),Be(q,O,G,ee)}if(_e(G))return me(q,O,G,ee);if(de(G)){if(xe=de(G),typeof xe!="function")throw Error(u(150));return G=xe.call(G),be(q,O,G,ee)}if(typeof G.then=="function")return Be(q,O,Gu(G),ee);if(G.$$typeof===ae)return Be(q,O,qu(q,G),ee);Qu(q,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,O!==null&&O.tag===6?(l(q,O.sibling),ee=o(O,G),ee.return=q,q=ee):(l(q,O),ee=Qs(G,q.mode,ee),ee.return=q,q=ee),b(q)):l(q,O)}return function(q,O,G,ee){try{ka=0;var xe=Be(q,O,G,ee);return kr=null,xe}catch(Ne){if(Ne===wr||Ne===Vu)throw Ne;var $e=dn(29,Ne,null,q.mode);return $e.lanes=ee,$e.return=q,$e}finally{}}}var qi=sm(!0),cm=sm(!1),Wl=!1;function nc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ei(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ti(e,t,l){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(tt&2)!==0){var o=i.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),i.pending=t,t=Mu(e),Ih(e,null,l),t}return Du(e,i,t,l),Mu(e)}function Sa(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,pu(e,l)}}function ic(e,t){var l=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,l===i)){var o=null,c=null;if(l=l.firstBaseUpdate,l!==null){do{var b={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};c===null?o=c=b:c=c.next=b,l=l.next}while(l!==null);c===null?o=c=t:c=c.next=t}else o=c=t;l={baseState:i.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:i.shared,callbacks:i.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var rc=!1;function Na(){if(rc){var e=vr;if(e!==null)throw e}}function Ea(e,t,l,i){rc=!1;var o=e.updateQueue;Wl=!1;var c=o.firstBaseUpdate,b=o.lastBaseUpdate,k=o.shared.pending;if(k!==null){o.shared.pending=null;var j=k,F=j.next;j.next=null,b===null?c=F:b.next=F,b=j;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,k=Z.lastBaseUpdate,k!==b&&(k===null?Z.firstBaseUpdate=F:k.next=F,Z.lastBaseUpdate=j))}if(c!==null){var te=o.baseState;b=0,Z=F=j=null,k=c;do{var H=k.lane&-536870913,X=H!==k.lane;if(X?(Ze&H)===H:(i&H)===H){H!==0&&H===Li&&(rc=!0),Z!==null&&(Z=Z.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var me=e,be=k;H=t;var Be=l;switch(be.tag){case 1:if(me=be.payload,typeof me=="function"){te=me.call(Be,te,H);break e}te=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=be.payload,H=typeof me=="function"?me.call(Be,te,H):me,H==null)break e;te=R({},te,H);break e;case 2:Wl=!0}}H=k.callback,H!==null&&(e.flags|=64,X&&(e.flags|=8192),X=o.callbacks,X===null?o.callbacks=[H]:X.push(H))}else X={lane:H,tag:k.tag,payload:k.payload,callback:k.callback,next:null},Z===null?(F=Z=X,j=te):Z=Z.next=X,b|=H;if(k=k.next,k===null){if(k=o.shared.pending,k===null)break;X=k,k=X.next,X.next=null,o.lastBaseUpdate=X,o.shared.pending=null}}while(!0);Z===null&&(j=te),o.baseState=j,o.firstBaseUpdate=F,o.lastBaseUpdate=Z,c===null&&(o.shared.lanes=0),oi|=b,e.lanes=b,e.memoizedState=te}}function fm(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function dm(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;ec?c:8;var b=pe.T,k={};k.types=b!==null?b.types:null,pe.T=k,Ec(e,!1,t,l);try{var j=o(),F=pe.S;if(F!==null&&F(k,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var Z=f1(j,i);_a(e,t,Z,Cn(e))}else _a(e,t,i,Cn(e))}catch(te){_a(e,t,{then:function(){},status:"rejected",reason:te},Cn())}finally{Se.p=c,b!==null&&k.types!==null&&(b.types=k.types),pe.T=b}}function x1(){}function Sc(e,t,l,i){if(e.tag!==5)throw Error(u(476));var o=Gm(e).queue;Ym(e,o,t,Rt,l===null?x1:function(){return Qm(e),l(i)})}function Gm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Rt,baseState:Rt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ol,lastRenderedState:Rt},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ol,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qm(e){var t=Gm(e);t.next===null&&(t=e.alternate.memoizedState),_a(e,t.next.queue,{},Cn())}function Nc(){return Xt(Gr)}function Xm(){return Ct().memoizedState}function Im(){return Ct().memoizedState}function y1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Cn();e=ei(l);var i=ti(t,e,l);i!==null&&(gn(i,t,l),Sa(i,t,l)),t={cache:Ps()},e.payload=t;return}t=t.return}}function b1(e,t,l){var i=Cn();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},to(e)?Zm(t,l):(l=Ys(e,t,l,i),l!==null&&(gn(l,e,i),$m(l,t,i)))}function Km(e,t,l){var i=Cn();_a(e,t,l,i)}function _a(e,t,l,i){var o={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(to(e))Zm(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var b=t.lastRenderedState,k=c(b,l);if(o.hasEagerState=!0,o.eagerState=k,kn(k,b))return Du(e,t,o,0),dt===null&&zu(),!1}catch{}finally{}if(l=Ys(e,t,o,i),l!==null)return gn(l,e,i),$m(l,t,i),!0}return!1}function Ec(e,t,l,i){if(i={lane:2,revertLane:gf(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},to(e)){if(t)throw Error(u(479))}else t=Ys(e,l,i,2),t!==null&&gn(t,e,2)}function to(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function Zm(e,t){Sr=Ku=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function $m(e,t,l){if((l&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,pu(e,l)}}var no={readContext:Xt,use:Ju,useCallback:wt,useContext:wt,useEffect:wt,useImperativeHandle:wt,useLayoutEffect:wt,useInsertionEffect:wt,useMemo:wt,useReducer:wt,useRef:wt,useState:wt,useDebugValue:wt,useDeferredValue:wt,useTransition:wt,useSyncExternalStore:wt,useId:wt,useHostTransitionStatus:wt,useFormState:wt,useActionState:wt,useOptimistic:wt,useMemoCache:wt,useCacheRefresh:wt,useEffectEvent:wt},Jm={readContext:Xt,use:Ju,useCallback:function(e,t){return sn().memoizedState=[e,t===void 0?null:t],e},useContext:Xt,useEffect:Om,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Wu(4194308,4,Bm.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Wu(4194308,4,e,t)},useInsertionEffect:function(e,t){Wu(4,2,e,t)},useMemo:function(e,t){var l=sn();t=t===void 0?null:t;var i=e();if(Fi){jt(!0);try{e()}finally{jt(!1)}}return l.memoizedState=[i,t],i},useReducer:function(e,t,l){var i=sn();if(l!==void 0){var o=l(t);if(Fi){jt(!0);try{l(t)}finally{jt(!1)}}}else o=t;return i.memoizedState=i.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},i.queue=e,e=e.dispatch=b1.bind(null,Ue,e),[i.memoizedState,e]},useRef:function(e){var t=sn();return e={current:e},t.memoizedState=e},useState:function(e){e=yc(e);var t=e.queue,l=Km.bind(null,Ue,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:wc,useDeferredValue:function(e,t){var l=sn();return kc(l,e,t)},useTransition:function(){var e=yc(!1);return e=Ym.bind(null,Ue,e.queue,!0,!1),sn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var i=Ue,o=sn();if(Fe){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),dt===null)throw Error(u(349));(Ze&127)!==0||ym(i,t,l)}o.memoizedState=l;var c={value:l,getSnapshot:t};return o.queue=c,Om(vm.bind(null,i,c,e),[e]),i.flags|=2048,Er(9,{destroy:void 0},bm.bind(null,i,c,l,t),null),l},useId:function(){var e=sn(),t=dt.identifierPrefix;if(Fe){var l=sl,i=ol;l=(i&~(1<<32-Ke(i)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Zu++,0<\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof i.is=="string"?b.createElement("select",{is:i.is}):b.createElement("select"),i.multiple?c.multiple=!0:i.size&&(c.size=i.size);break;default:c=typeof i.is=="string"?b.createElement(o,{is:i.is}):b.createElement(o)}}c[Lt]=t,c[ln]=i;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)c.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=c;e:switch($t(c,o,i),o){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Ll(t)}}return yt(t),t.subtreeFlags&=-33554433,Bc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Ll(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(u(166));if(e=tn.current,br(t)){if(e=t.stateNode,l=t.memoizedProps,i=null,o=Ft,o!==null)switch(o.tag){case 27:case 5:i=o.memoizedProps}e[Lt]=t,e=!!(e.nodeValue===l||i!==null&&i.suppressHydrationWarning===!0||vg(e.nodeValue,l)),e||$l(t,!0)}else e=Va(e).createTextNode(i),e[Lt]=t,t.stateNode=e}return yt(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(i=br(t),l!==null){if(e===null){if(!i)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Lt]=t}else Di(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;yt(t),e=!1}else l=Zs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Sn(t),t):(Sn(t),null);if((t.flags&128)!==0)throw Error(u(558))}return yt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=br(t),i!==null&&i.dehydrated!==null){if(e===null){if(!o)throw Error(u(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(u(317));o[Lt]=t}else Di(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;yt(t),o=!1}else o=Zs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Sn(t),t):(Sn(t),null)}return Sn(t),(t.flags&128)!==0?(t.lanes=l,t):(l=i!==null,e=e!==null&&e.memoizedState!==null,l&&(i=t.child,o=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(o=i.alternate.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==o&&(i.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),oo(t,t.updateQueue),yt(t),null);case 4:return Me(),e===null&&vf(t.stateNode.containerInfo),t.flags|=67108864,yt(t),null;case 10:return Dl(t.type),yt(t),null;case 19:if(sc(t),i=t.memoizedState,i===null)return yt(t),null;if(o=(t.flags&128)!==0,c=i.rendering,c===null)if(o)za(i,!1);else{if(kt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Iu(e),c!==null){for(t.flags|=128,za(i,!1),e=c.updateQueue,t.updateQueue=e,oo(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Kh(l,e),l=l.sibling;return ja(t,Kt.current&1|2),Fe&&Al(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Nt()>wo&&(t.flags|=128,o=!0,za(i,!1),t.lanes=4194304)}else{if(!o)if(e=Iu(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,oo(t,e),za(i,!0),i.tail===null&&i.tailMode!=="collapsed"&&i.tailMode!=="visible"&&!c.alternate&&!Fe)return yt(t),null}else 2*Nt()-i.renderingStartTime>wo&&l!==536870912&&(t.flags|=128,o=!0,za(i,!1),t.lanes=4194304);i.isBackwards?(c.sibling=t.child,t.child=c):(e=i.last,e!==null?e.sibling=c:t.child=c,i.last=c)}if(i.tail!==null){e=i.tail;e:{for(l=e;l!==null;){if(l.alternate!==null){l=!1;break e}l=l.sibling}l=!0}return i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Nt(),e.sibling=null,c=Kt.current,c=o?c&1|2:c&1,i.tailMode==="visible"||i.tailMode==="collapsed"||!l||Fe?ja(t,c):(l=c,Je(It,t),Je(Kt,l),rn===null&&(rn=t)),Fe&&Al(t,i.treeForkCount),e}return yt(t),null;case 22:case 23:return Sn(t),uc(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(l&536870912)!==0&&(t.flags&128)===0&&(yt(t),t.subtreeFlags&6&&(t.flags|=8192)):yt(t),l=t.updateQueue,l!==null&&oo(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==l&&(t.flags|=2048),e!==null&&nt(Ui),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Dl(At),yt(t),null;case 25:return null;case 30:return t.flags|=33554432,yt(t),null}throw Error(u(156,t.tag))}function j1(e,t){switch(Is(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Dl(At),Me(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return lt(t),null;case 31:if(t.memoizedState!==null){if(Sn(t),t.alternate===null)throw Error(u(340));Di()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Sn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Di()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return sc(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Me(),null;case 10:return Dl(t.type),null;case 22:case 23:return Sn(t),uc(),e!==null&&nt(Ui),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Dl(At),null;case 25:return null;default:return null}}function kp(e,t){switch(Is(t),t.tag){case 3:Dl(At),Me();break;case 26:case 27:case 5:lt(t);break;case 4:Me();break;case 31:t.memoizedState!==null&&Sn(t);break;case 13:Sn(t);break;case 19:sc(t);break;case 10:Dl(t.type);break;case 22:case 23:Sn(t),uc(),e!==null&&nt(Ui);break;case 24:Dl(At)}}function Da(e,t){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var o=i.next;l=o;do{if((l.tag&e)===e){i=void 0;var c=l.create,b=l.inst;i=c(),b.destroy=i}l=l.next}while(l!==o)}}catch(k){ot(t,t.return,k)}}function ri(e,t,l){try{var i=t.updateQueue,o=i!==null?i.lastEffect:null;if(o!==null){var c=o.next;i=c;do{if((i.tag&e)===e){var b=i.inst,k=b.destroy;if(k!==void 0){b.destroy=void 0,o=t;var j=l,F=k;try{F()}catch(Z){ot(o,j,Z)}}}i=i.next}while(i!==c)}}catch(Z){ot(t,t.return,Z)}}function Sp(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{dm(t,l)}catch(i){ot(e,e.return,i)}}}function Np(e,t,l){l.props=Vi(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(i){ot(e,t,i)}}function cl(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:var o=e.stateNode,c=Cl(e.memoizedProps,o);(o.ref===null||o.ref.name!==c)&&(o.ref=zg(c)),i=o.ref;break;case 7:if(e.stateNode===null){var b=new Tn(e);g(e.child,!1,gv,b,void 0,void 0),e.stateNode=b}i=e.stateNode;break;default:i=e.stateNode}typeof l=="function"?e.refCleanup=l(i):l.current=i}}catch(k){ot(e,t,k)}}function Zt(e,t){var l=e.ref,i=e.refCleanup;if(l!==null)if(typeof i=="function")try{i()}catch(o){ot(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(o){ot(e,t,o)}else l.current=null}function so(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var l=0;l title"))),$t(i,t,l),i[Lt]=e,_t(i),t=i;break e;case"link":if(c=Kg("link","href",o).get(t+(l.href||""))){for(b=0;bBe&&(b=Be,Be=be,be=b);var q=Lh(k,be),O=Lh(k,Be);if(q&&O&&(X.rangeCount!==1||X.anchorNode!==q.node||X.anchorOffset!==q.offset||X.focusNode!==O.node||X.focusOffset!==O.offset)){var G=te.createRange();G.setStart(q.node,q.offset),X.removeAllRanges(),be>Be?(X.addRange(G),X.extend(O.node,O.offset)):(G.setEnd(O.node,O.offset),X.addRange(G))}}}}for(te=[],X=k;X=X.parentNode;)X.nodeType===1&&te.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;kl?32:l,pe.T=null,l=af,af=null;var c=Jn,b=gl;if(vt=0,Xi=Jn=null,gl=0,(tt&6)!==0)throw Error(u(331));var k=tt;if(tt|=4,Ip(c.current),Gp(c,c.current,b,l),tt=k,Ha(0,!1),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(pt,c)}catch{}return!0}finally{Se.p=o,pe.T=i,og(e,t)}}function sg(e,t,l){t=Ln(l,t),t=Tc(e.stateNode,t,2),e=ti(e,t,2),e!==null&&(Fl(e,2),xl(e))}function ot(e,t,l){if(e.tag===3)sg(e,e,l);else for(;t!==null;){if(t.tag===3){sg(t,e,l);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(si===null||!si.has(i))){e=Ln(l,e),l=rp(2),i=ti(t,l,2),i!==null&&(ap(l,i,t,e),Fl(i,2),xl(i));break}}t=t.return}}function hf(e,t,l){var i=e.pingCache;if(i===null){i=e.pingCache=new A1;var o=new Set;i.set(t,o)}else o=i.get(t),o===void 0&&(o=new Set,i.set(t,o));o.has(l)||(nf=!0,o.add(l),e=B1.bind(null,e,t,l),t.then(e,e))}function B1(e,t,l){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,dt===e&&(Ze&l)===l&&((kt===4||kt===3&&(Ze&62914560)===Ze&&300>Nt()-vo)&&(tt&2)===0?Lr(e,0):bo|=l,zr===Ze&&(zr=0)),xl(e)}function cg(e,t){t===0&&(t=hu()),e=Ai(e,t),e!==null&&(Fl(e,t),xl(e))}function H1(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),cg(e,l)}function q1(e,t){var l=0;switch(e.tag){case 31:case 13:var i=e.stateNode,o=e.memoizedState;o!==null&&(l=o.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(u(314))}i!==null&&i.delete(t),cg(e,l)}function F1(e,t){return zn(e,t)}var Br=null,Hr=null,mf=!1,To=!1,pf=!1,fi=0;function xl(e){e!==Hr&&e.next===null&&(Hr===null?Br=Hr=e:Hr=Hr.next=e),To=!0,mf||(mf=!0,Y1())}function Ha(e,t){if(!pf&&To){pf=!0;do for(var l=!1,i=Br;i!==null;){if(e!==0){var o=i.pendingLanes;if(o===0)var c=0;else{var b=i.suspendedLanes,k=i.pingedLanes;c=(1<<31-Ke(42|e)+1)-1,c&=o&~(b&~k),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(l=!0,mg(i,c))}else c=Ze,c=ir(i,i===dt?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(c&3)===0||kl(i,c)||(l=!0,mg(i,c));i=i.next}while(l);pf=!1}}function V1(){fg()}function fg(){To=mf=!1;var e=0;fi!==0&&ev()&&(e=fi);for(var t=Nt(),l=null,i=Br;i!==null;){var o=i.next,c=dg(i,t);c===0?(i.next=null,l===null?Br=o:l.next=o,o===null&&(Hr=l)):(l=i,(e!==0||(c&3)!==0)&&(To=!0)),i=o}vt!==0&&vt!==5||Ha(e),fi!==0&&(fi=0)}function dg(e,t){for(var l=e.suspendedLanes,i=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0k)break;var Z=j.transferSize,te=j.initiatorType;Z&&wg(te)&&(j=j.responseEnd,b+=Z*(jMo){be.length=me;break}G=new Promise(av.bind(G)),be.push(G)}}}if(0"u"?null:document;function Gg(e,t,l){var i=Fr;if(i&&typeof t=="string"&&t){var o=Oe(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof l=="string"&&(o+='[crossorigin="'+l+'"]'),Yg.has(o)||(Yg.add(o),e={rel:e,crossOrigin:l,href:t},i.querySelector(o)===null&&(t=i.createElement("link"),$t(t,"link",e),_t(t),i.head.appendChild(t)))}}function Ev(e){Bl.D(e),Gg("dns-prefetch",e,null)}function jv(e,t){Bl.C(e,t),Gg("preconnect",e,t)}function Cv(e,t,l){Bl.L(e,t,l);var i=Fr;if(i&&e&&t){var o='link[rel="preload"][as="'+Oe(t)+'"]';t==="image"&&l&&l.imageSrcSet?(o+='[imagesrcset="'+Oe(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(o+='[imagesizes="'+Oe(l.imageSizes)+'"]')):o+='[href="'+Oe(e)+'"]';var c=o;switch(t){case"style":c=Vr(e);break;case"script":c=Yr(e)}if(!(Vn.has(c)||(e=R({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Vn.set(c,e),i.querySelector(o)!==null||t==="style"&&i.querySelector(Ga(c))||t==="script"&&i.querySelector(Qa(c))))){var b=i.createElement("link");$t(b,"link",e),t==="style"&&(b[rr]=!0,b.onload=b.onerror=function(){yu(b)}),_t(b),i.head.appendChild(b)}}}function Tv(e,t){Bl.m(e,t);var l=Fr;if(l&&e){var i=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Oe(i)+'"][href="'+Oe(e)+'"]',c=o;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Yr(e)}if(!Vn.has(c)&&(e=R({rel:"modulepreload",href:e},t),Vn.set(c,e),l.querySelector(o)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Qa(c)))return}i=l.createElement("link"),$t(i,"link",e),_t(i),l.head.appendChild(i)}}}function _v(e,t,l){Bl.S(e,t,l);var i=Fr;if(i&&e){var o=Gl(i).hoistableStyles,c=Vr(e);t=t||"default";var b=o.get(c);if(!b){var k={loading:0,preload:null};if(b=i.querySelector(Ga(c)))k.loading=5;else{e=R({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Vn.get(c))&&Lf(e,l);var j=b=i.createElement("link");_t(j),$t(j,"link",e),j._p=new Promise(function(F,Z){j.onload=F,j.onerror=Z}),j.addEventListener("load",function(){k.loading|=1}),j.addEventListener("error",function(){k.loading|=2}),k.loading|=4,zo(b,t,i)}b={type:"stylesheet",instance:b,count:1,state:k},o.set(c,b)}}}function Av(e,t){Bl.X(e,t);var l=Fr;if(l&&e){var i=Gl(l).hoistableScripts,o=Yr(e),c=i.get(o);c||(c=l.querySelector(Qa(o)),c||(e=R({src:e,async:!0},t),(t=Vn.get(o))&&Uf(e,t),c=l.createElement("script"),_t(c),$t(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(o,c))}}function zv(e,t){Bl.M(e,t);var l=Fr;if(l&&e){var i=Gl(l).hoistableScripts,o=Yr(e),c=i.get(o);c||(c=l.querySelector(Qa(o)),c||(e=R({src:e,async:!0,type:"module"},t),(t=Vn.get(o))&&Uf(e,t),c=l.createElement("script"),_t(c),$t(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(o,c))}}function Qg(e,t,l,i){var o=(o=tn.current)?Ya(o):null;if(!o)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(l=Vr(l.href),t=Gl(o).hoistableStyles,i=t.get(l),i||(i={type:"style",instance:null,count:0,state:null},t.set(l,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Vr(l.href);var c=Gl(o).hoistableStyles,b=c.get(e);if(b||(o=o.ownerDocument||o,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,b),(c=o.querySelector(Ga(e)))?c._p||(b.instance=c,b.state.loading=5):(c=Vn.get(e),c||(c={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Vn.set(e,c)),Dv(o,e,c,b.state))),t&&i===null)throw Error(u(528,""));return b}if(t&&i!==null)throw Error(u(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(l=Yr(l),t=Gl(o).hoistableScripts,i=t.get(l),i||(i={type:"script",instance:null,count:0,state:null},t.set(l,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Vr(e){return'href="'+Oe(e)+'"'}function Ga(e){return'link[rel="stylesheet"]['+e+"]"}function Xg(e){return R({},e,{"data-precedence":e.precedence,precedence:null})}function Dv(e,t,l,i){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[rr]!==!0){i.loading=1;return}}else t=e.createElement("link"),t[rr]=!0,t.onload=t.onerror=yu.bind(null,t),$t(t,"link",l),_t(t),e.head.appendChild(t);i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2})}function Yr(e){return'[src="'+Oe(e)+'"]'}function Qa(e){return"script[async]"+e}function Ig(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Oe(l.href)+'"]');if(i)return t.instance=i,_t(i),i;var o=R({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),_t(i),$t(i,"style",o),zo(i,l.precedence,e),t.instance=i;case"stylesheet":o=Vr(l.href);var c=e.querySelector(Ga(o));if(c)return t.state.loading|=4,t.instance=c,_t(c),c;i=Xg(l),(o=Vn.get(o))&&Lf(i,o),c=(e.ownerDocument||e).createElement("link"),_t(c);var b=c;return b._p=new Promise(function(k,j){b.onload=k,b.onerror=j}),$t(c,"link",i),t.state.loading|=4,zo(c,l.precedence,e),t.instance=c;case"script":return c=Yr(l.src),(o=e.querySelector(Qa(c)))?(t.instance=o,_t(o),o):(i=l,(o=Vn.get(c))&&(i=R({},l),Uf(i,o)),e=e.ownerDocument||e,o=e.createElement("script"),_t(o),$t(o,"link",i),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,zo(i,l.precedence,e));return t.instance}function zo(e,t,l){for(var i=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=i.length?i[i.length-1]:null,c=o,b=0;b title"):null)}function Mv(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Zg(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function $g(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Jg(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Pg(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=Jg(t),e.suspenseyImages.push(t)),e=Lv.bind(e),t.decode().then(e,e))}function Ov(e,t,l,i){if(l.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var o=Vr(i.href),c=t.querySelector(Ga(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Xa.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=c,_t(c);return}c=t.ownerDocument||t,i=Xg(i),(o=Vn.get(o))&&Lf(i,o),c=c.createElement("link"),_t(c);var b=c;b._p=new Promise(function(k,j){b.onload=k,b.onerror=j}),$t(c,"link",i),l.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Xa.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Mo=0;function Rv(e,t){return e.stylesheets&&e.count===0&&Ro(e,e.stylesheets),0Mo?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(o)}}:null}function Wg(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Ro(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Xa(){this.count--,Wg(this)}function Lv(){this.imgCount--,Wg(this)}var Oo=null;function Ro(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Oo=new Map,t.forEach(Uv,e),Oo=null,Xa.call(e))}function Uv(e,t){if(!(t.state.loading&4)){var l=Oo.get(e);if(l)var i=l.get(null);else{l=new Map,Oo.set(e,l);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Kf.exports=t2(),Kf.exports}var l2=n2();const i2=Hd(l2);class r2 extends Error{constructor(a,u){super(a);Qf(this,"status");this.name="ApiError",this.status=u}}async function Fd(n,r){let a=r;try{const u=await n.json();u!=null&&u.detail&&(a=u.detail)}catch{}return new r2(a,n.status)}async function a2(n){const r=await fetch(`/api/notifications?after=${n}`);if(!r.ok)throw new Error("Failed to fetch notifications");return r.json()}async function u2(){const n=await fetch("/api/actions/open-log",{method:"POST"});if(!n.ok)throw new Error("Failed to open log file");return n.json()}async function o2(n){const r=new URLSearchParams;r.set("limit",String(n.limit)),n!=null&&n.level&&r.set("level",n.level),n!=null&&n.search&&r.set("search",n.search);const a=await fetch(`/api/logs?${r.toString()}`);if(!a.ok)throw new Error("Failed to fetch log entries");return a.json()}async function Vo(){const n=await fetch("/api/system");if(!n.ok)throw new Error("Failed to fetch system info");return n.json()}async function s2(n){const r=await fetch("/api/system/bind",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lan:n})});if(!r.ok){let a="Failed to update LAN binding";try{const u=await r.json();u!=null&&u.detail&&(a=u.detail)}catch{}throw new Error(a)}return r.json()}async function Sx(){const n=await fetch("/api/config");if(!n.ok)throw new Error("Failed to fetch app configuration");return n.json()}async function Nx(n){const r=await fetch("/api/config/select-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({directory:n})});if(!r.ok)throw new Error("Failed to select directory");return r.json()}async function c2(n){const r=await fetch("/api/config/load",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config_path:n})});if(!r.ok)throw new Error("Failed to load config file");return r.json()}async function f2(n,r){const a=await fetch("/api/config/load-content",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:n,content:r})});if(!a.ok){let u=`Failed to apply dropped config (${n})`;try{const s=await a.json();s!=null&&s.detail&&(u=s.detail)}catch{}throw new Error(u)}return a.json()}async function d2(){const n=await fetch("/api/config/reload",{method:"POST"});if(!n.ok){let r="Failed to reload configuration";try{const a=await n.json();a!=null&&a.detail&&(r=a.detail)}catch{}throw new Error(r)}return n.json()}async function h2(n){const r=await fetch("/api/config/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({directory:n})});if(!r.ok)throw new Error("Failed to create config file");return r.json()}async function m2(n){const r=`/api/fs/browse?path=${encodeURIComponent(n)}&include_hidden=true`,a=await fetch(r);if(!a.ok)throw new Error("Failed to browse config files");return a.json()}async function p2(n){const r=`/api/fs/browse?path=${encodeURIComponent(n)}`,a=await fetch(r);if(!a.ok)throw new Error("Failed to browse directory");return a.json()}async function Ex(n,r){const a=await fetch("/api/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:r});if(!a.ok)throw new Error("Failed to execute scan");return a.json()}async function Pf(n){const r=new URLSearchParams;(n==null?void 0:n.offset)!=null&&r.set("offset",String(n.offset)),(n==null?void 0:n.limit)!=null&&r.set("limit",String(n.limit)),n!=null&&n.sort_by&&r.set("sort_by",n.sort_by),n!=null&&n.sort_dir&&r.set("sort_dir",n.sort_dir);const a=r.toString(),u=`/api/scan/results${a?`?${a}`:""}`,s=await fetch(u,{signal:n==null?void 0:n.signal});if(!s.ok)throw new Error("Failed to fetch scan results");return s.json()}async function g2(n){const r=await fetch("/api/actions/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error("Failed to launch file");return r.json()}async function Yy(n){const r=await fetch("/api/actions/reveal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n})});if(!r.ok)throw new Error("Failed to reveal file");return r.json()}async function yd(n){const r=await fetch("/api/actions/open-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n})});if(!r.ok)throw new Error("Failed to open folder");return r.json()}async function jx(n){const r=await fetch("/api/actions/open-terminal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n})});if(!r.ok)throw new Error("Failed to open terminal");return r.json()}async function Cx(n,r){const a=await fetch("/api/actions/hash",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n,algorithm:r})});if(!a.ok)throw new Error("Failed to compute hash");return a.json()}async function Tx(){const n=await fetch("/api/actions/open-config",{method:"POST"});if(!n.ok)throw new Error("Failed to open config file");return n.json()}async function _x(n){const r={file_path:n.file_path||n.filePath,content:n.content},a=await fetch("/api/actions/barcode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw new Error("Failed to generate barcode");return a.json()}async function x2(n){const r=await fetch("/api/actions/barcode/decode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image_base64:n.imageBase64,formats:n.formats})});if(!r.ok)throw r.status===503?new Error("Server-side barcode decoding is unavailable"):new Error(`Failed to decode frame (HTTP ${r.status})`);return r.json()}async function y2(n,r){const a=await fetch("/api/actions/metadata",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n}),signal:r});if(!a.ok)throw new Error("Failed to fetch metadata");return a.json()}async function b2(n,r){const a=await fetch("/api/actions/export-csv",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n,filename:r})});if(!a.ok)throw new Error("Failed to export CSV");return a.json()}async function v2(n,r){const a=await fetch("/api/actions/save-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image_base64:n,filename:r})});if(!a.ok)throw new Error("Failed to save image");return a.json()}async function w2(n){const r=await fetch("/api/workflow/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw await Fd(r,"Failed to start workflow session");return r.json()}async function k2(n,r){const a=await fetch(`/api/workflow/${n}/respond`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:r})});if(!a.ok)throw await Fd(a,"Failed to respond to workflow prompt");return a.json()}async function S2(n){const r=await fetch(`/api/workflow/${n}/abort`,{method:"POST"});if(!r.ok)throw await Fd(r,"Failed to abort workflow session");return r.json()}const N2=[".profiles",".profiles.yaml",".profiles.yml",".yaml",".yml"];function E2(n){const r=n.toLowerCase();return N2.some(a=>r.endsWith(a))}function j2(n){for(const r of n)if(E2(r.name))return r;return null}function Wo(){return{depth:0,overlayVisible:!1}}function Ax(n,r,a){switch(r){case"enter":return a?{depth:n.depth+1,overlayVisible:!0}:n;case"leave":{const u=Math.max(0,n.depth-1);return{depth:u,overlayVisible:n.depth>0&&u>0}}case"drop":return Wo()}}function zx(n){return n==="light"?"light":"dark"}/** +`+i.stack}}var nn=Object.prototype.hasOwnProperty,zn=n.unstable_scheduleCallback,Dn=n.unstable_cancelCallback,Mn=n.unstable_shouldYield,ll=n.unstable_requestPaint,Nt=n.unstable_now,Et=n.unstable_getCurrentPriorityLevel,Gn=n.unstable_ImmediatePriority,Qt=n.unstable_UserBlockingPriority,il=n.unstable_NormalPriority,he=n.unstable_LowPriority,fu=n.unstable_IdlePriority,xs=n.log,vn=n.unstable_setDisableYieldValue,pt=null,gt=null;function jt(e){if(typeof xs=="function"&&vn(e),gt&&typeof gt.setStrictMode=="function")try{gt.setStrictMode(pt,e)}catch{}}var Ke=Math.clz32?Math.clz32:On,ys=Math.log,du=Math.LN2;function On(e){return e>>>=0,e===0?32:31-(ys(e)/du|0)|0}var lr=256,Si=262144,ql=4194304;function wl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ir(e,t,l){var i=e.pendingLanes;if(i===0)return 0;var o=0,c=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var k=i&134217727;return k!==0?(i=k&~c,i!==0?o=wl(i):(b&=k,b!==0?o=wl(b):l||(l=k&~e,l!==0&&(o=wl(l))))):(k=i&~c,k!==0?o=wl(k):b!==0?o=wl(b):l||(l=i&~e,l!==0&&(o=wl(l)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,l=t&-t,c>=l||c===32&&(l&4194048)!==0)?t:o}function kl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ni(e,t){(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0l;l++)t.push(e);return t}function Fl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function bs(e,t,l,i,o,c){var b=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var k=e.entanglements,j=e.expirationTimes,F=e.hiddenUpdates;for(l=b&~l;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cs=!1;if(jl)try{var sa={};Object.defineProperty(sa,"passive",{get:function(){Cs=!0}}),window.addEventListener("test",sa,sa),window.removeEventListener("test",sa,sa)}catch{Cs=!1}var Xl=null,Ts=null,Nu=null;function yh(){if(Nu)return Nu;var e,t=Ts,l=t.length,i,o="value"in Xl?Xl.value:Xl.textContent,c=o.length;for(e=0;e=da),Nh=" ",Eh=!1;function jh(e,t){switch(e){case"keyup":return Y0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ch(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var dr=!1;function Q0(e,t){switch(e){case"compositionend":return Ch(t);case"keypress":return t.which!==32?null:(Eh=!0,Nh);case"textInput":return e=t.data,e===Nh&&Eh?null:e;default:return null}}function X0(e,t){if(dr)return e==="compositionend"||!Ms&&jh(e,t)?(e=yh(),Nu=Ts=Xl=null,dr=!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"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Rh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lh(e,t){var l=Rh(e);e=0;for(var i;l;){if(l.nodeType===3){if(i=e+l.textContent.length,e<=t&&i>=t)return{node:l,offset:t-e};e=i}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Rh(l)}}function Uh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Uh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Bh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ls(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=Ls(e.document)}return t}function Us(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var e1=jl&&"documentMode"in document&&11>=document.documentMode,hr=null,Bs=null,ga=null,Hs=!1;function Hh(e,t,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Hs||hr==null||hr!==Ls(i)||(i=hr,"selectionStart"in i&&Us(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),ga&&pa(ga,i)||(ga=i,i=Ao(Bs,"onSelect"),0>=b,o-=b,ol=1<<32-Ke(t)+o|l<Ae?(Mt=Ne,Ne=null):Mt=Ne.sibling;var We=H(q,Ne,G[Ae],ee);if(We===null){Ne===null&&(Ne=Mt);break}e&&Ne&&We.alternate===null&&t(q,Ne),O=c(We,O,Ae),$e===null?xe=We:$e.sibling=We,$e=We,Ne=Mt}if(Ae===G.length)return l(q,Ne),Fe&&Al(q,Ae),xe;if(Ne===null){for(;AeAe?(Mt=Ne,Ne=null):Mt=Ne.sibling;var xi=H(q,Ne,We.value,ee);if(xi===null){Ne===null&&(Ne=Mt);break}e&&Ne&&xi.alternate===null&&t(q,Ne),O=c(xi,O,Ae),$e===null?xe=xi:$e.sibling=xi,$e=xi,Ne=Mt}if(We.done)return l(q,Ne),Fe&&Al(q,Ae),xe;if(Ne===null){for(;!We.done;Ae++,We=G.next())We=te(q,We.value,ee),We!==null&&(O=c(We,O,Ae),$e===null?xe=We:$e.sibling=We,$e=We);return Fe&&Al(q,Ae),xe}for(Ne=i(Ne);!We.done;Ae++,We=G.next())We=X(Ne,q,Ae,We.value,ee),We!==null&&(e&&(Mt=We.alternate,Mt!==null&&Ne.delete(Mt.key===null?Ae:Mt.key)),O=c(We,O,Ae),$e===null?xe=We:$e.sibling=We,$e=We);return e&&Ne.forEach(function(Qv){return t(q,Qv)}),Fe&&Al(q,Ae),xe}function Be(q,O,G,ee){if(typeof G=="object"&&G!==null&&G.type===ne&&G.key===null&&G.props.ref===void 0&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case fe:e:{for(var xe=G.key;O!==null;){if(O.key===xe){if(xe=G.type,xe===ne){if(O.tag===7){l(q,O.sibling),ee=o(O,G.props.children),Pl(ee,G),ee.return=q,q=ee;break e}}else if(O.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===N&&Bi(xe)===O.type){l(q,O.sibling),ee=o(O,G.props),Pl(ee,G),ee.return=q,q=ee;break e}l(q,O);break}else t(q,O);O=O.sibling}G.type===ne?(ee=zi(G.props.children,q.mode,ee,G.key),Pl(ee,G),ee.return=q,q=ee):(ee=Ou(G.type,G.key,G.props,null,q.mode,ee),Pl(ee,G),ee.return=q,q=ee)}return b(q);case B:e:{for(xe=G.key;O!==null;){if(O.key===xe)if(O.tag===4&&O.stateNode.containerInfo===G.containerInfo&&O.stateNode.implementation===G.implementation){l(q,O.sibling),ee=o(O,G.children||[]),ee.return=q,q=ee;break e}else{l(q,O);break}else t(q,O);O=O.sibling}ee=Xs(G,q.mode,ee),ee.return=q,q=ee}return b(q);case N:return G=Bi(G),Be(q,O,G,ee)}if(_e(G))return me(q,O,G,ee);if(de(G)){if(xe=de(G),typeof xe!="function")throw Error(u(150));return G=xe.call(G),be(q,O,G,ee)}if(typeof G.then=="function")return Be(q,O,Gu(G),ee);if(G.$$typeof===ae)return Be(q,O,qu(q,G),ee);Qu(q,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,O!==null&&O.tag===6?(l(q,O.sibling),ee=o(O,G),ee.return=q,q=ee):(l(q,O),ee=Qs(G,q.mode,ee),ee.return=q,q=ee),b(q)):l(q,O)}return function(q,O,G,ee){try{ka=0;var xe=Be(q,O,G,ee);return kr=null,xe}catch(Ne){if(Ne===wr||Ne===Vu)throw Ne;var $e=dn(29,Ne,null,q.mode);return $e.lanes=ee,$e.return=q,$e}finally{}}}var qi=sm(!0),cm=sm(!1),Wl=!1;function nc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ei(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ti(e,t,l){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(tt&2)!==0){var o=i.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),i.pending=t,t=Mu(e),Ih(e,null,l),t}return Du(e,i,t,l),Mu(e)}function Sa(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,pu(e,l)}}function ic(e,t){var l=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,l===i)){var o=null,c=null;if(l=l.firstBaseUpdate,l!==null){do{var b={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};c===null?o=c=b:c=c.next=b,l=l.next}while(l!==null);c===null?o=c=t:c=c.next=t}else o=c=t;l={baseState:i.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:i.shared,callbacks:i.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var rc=!1;function Na(){if(rc){var e=vr;if(e!==null)throw e}}function Ea(e,t,l,i){rc=!1;var o=e.updateQueue;Wl=!1;var c=o.firstBaseUpdate,b=o.lastBaseUpdate,k=o.shared.pending;if(k!==null){o.shared.pending=null;var j=k,F=j.next;j.next=null,b===null?c=F:b.next=F,b=j;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,k=Z.lastBaseUpdate,k!==b&&(k===null?Z.firstBaseUpdate=F:k.next=F,Z.lastBaseUpdate=j))}if(c!==null){var te=o.baseState;b=0,Z=F=j=null,k=c;do{var H=k.lane&-536870913,X=H!==k.lane;if(X?(Ze&H)===H:(i&H)===H){H!==0&&H===Li&&(rc=!0),Z!==null&&(Z=Z.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var me=e,be=k;H=t;var Be=l;switch(be.tag){case 1:if(me=be.payload,typeof me=="function"){te=me.call(Be,te,H);break e}te=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=be.payload,H=typeof me=="function"?me.call(Be,te,H):me,H==null)break e;te=R({},te,H);break e;case 2:Wl=!0}}H=k.callback,H!==null&&(e.flags|=64,X&&(e.flags|=8192),X=o.callbacks,X===null?o.callbacks=[H]:X.push(H))}else X={lane:H,tag:k.tag,payload:k.payload,callback:k.callback,next:null},Z===null?(F=Z=X,j=te):Z=Z.next=X,b|=H;if(k=k.next,k===null){if(k=o.shared.pending,k===null)break;X=k,k=X.next,X.next=null,o.lastBaseUpdate=X,o.shared.pending=null}}while(!0);Z===null&&(j=te),o.baseState=j,o.firstBaseUpdate=F,o.lastBaseUpdate=Z,c===null&&(o.shared.lanes=0),oi|=b,e.lanes=b,e.memoizedState=te}}function fm(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function dm(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;ec?c:8;var b=pe.T,k={};k.types=b!==null?b.types:null,pe.T=k,Ec(e,!1,t,l);try{var j=o(),F=pe.S;if(F!==null&&F(k,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var Z=f1(j,i);_a(e,t,Z,Cn(e))}else _a(e,t,i,Cn(e))}catch(te){_a(e,t,{then:function(){},status:"rejected",reason:te},Cn())}finally{Se.p=c,b!==null&&k.types!==null&&(b.types=k.types),pe.T=b}}function x1(){}function Sc(e,t,l,i){if(e.tag!==5)throw Error(u(476));var o=Gm(e).queue;Ym(e,o,t,Rt,l===null?x1:function(){return Qm(e),l(i)})}function Gm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Rt,baseState:Rt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ol,lastRenderedState:Rt},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ol,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qm(e){var t=Gm(e);t.next===null&&(t=e.alternate.memoizedState),_a(e,t.next.queue,{},Cn())}function Nc(){return Xt(Gr)}function Xm(){return Ct().memoizedState}function Im(){return Ct().memoizedState}function y1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Cn();e=ei(l);var i=ti(t,e,l);i!==null&&(gn(i,t,l),Sa(i,t,l)),t={cache:Ps()},e.payload=t;return}t=t.return}}function b1(e,t,l){var i=Cn();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},to(e)?Zm(t,l):(l=Ys(e,t,l,i),l!==null&&(gn(l,e,i),$m(l,t,i)))}function Km(e,t,l){var i=Cn();_a(e,t,l,i)}function _a(e,t,l,i){var o={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(to(e))Zm(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var b=t.lastRenderedState,k=c(b,l);if(o.hasEagerState=!0,o.eagerState=k,kn(k,b))return Du(e,t,o,0),dt===null&&zu(),!1}catch{}finally{}if(l=Ys(e,t,o,i),l!==null)return gn(l,e,i),$m(l,t,i),!0}return!1}function Ec(e,t,l,i){if(i={lane:2,revertLane:gf(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},to(e)){if(t)throw Error(u(479))}else t=Ys(e,l,i,2),t!==null&&gn(t,e,2)}function to(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function Zm(e,t){Sr=Ku=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function $m(e,t,l){if((l&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,pu(e,l)}}var no={readContext:Xt,use:Ju,useCallback:wt,useContext:wt,useEffect:wt,useImperativeHandle:wt,useLayoutEffect:wt,useInsertionEffect:wt,useMemo:wt,useReducer:wt,useRef:wt,useState:wt,useDebugValue:wt,useDeferredValue:wt,useTransition:wt,useSyncExternalStore:wt,useId:wt,useHostTransitionStatus:wt,useFormState:wt,useActionState:wt,useOptimistic:wt,useMemoCache:wt,useCacheRefresh:wt,useEffectEvent:wt},Jm={readContext:Xt,use:Ju,useCallback:function(e,t){return sn().memoizedState=[e,t===void 0?null:t],e},useContext:Xt,useEffect:Om,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Wu(4194308,4,Bm.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Wu(4194308,4,e,t)},useInsertionEffect:function(e,t){Wu(4,2,e,t)},useMemo:function(e,t){var l=sn();t=t===void 0?null:t;var i=e();if(Fi){jt(!0);try{e()}finally{jt(!1)}}return l.memoizedState=[i,t],i},useReducer:function(e,t,l){var i=sn();if(l!==void 0){var o=l(t);if(Fi){jt(!0);try{l(t)}finally{jt(!1)}}}else o=t;return i.memoizedState=i.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},i.queue=e,e=e.dispatch=b1.bind(null,Ue,e),[i.memoizedState,e]},useRef:function(e){var t=sn();return e={current:e},t.memoizedState=e},useState:function(e){e=yc(e);var t=e.queue,l=Km.bind(null,Ue,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:wc,useDeferredValue:function(e,t){var l=sn();return kc(l,e,t)},useTransition:function(){var e=yc(!1);return e=Ym.bind(null,Ue,e.queue,!0,!1),sn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var i=Ue,o=sn();if(Fe){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),dt===null)throw Error(u(349));(Ze&127)!==0||ym(i,t,l)}o.memoizedState=l;var c={value:l,getSnapshot:t};return o.queue=c,Om(vm.bind(null,i,c,e),[e]),i.flags|=2048,Er(9,{destroy:void 0},bm.bind(null,i,c,l,t),null),l},useId:function(){var e=sn(),t=dt.identifierPrefix;if(Fe){var l=sl,i=ol;l=(i&~(1<<32-Ke(i)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Zu++,0<\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof i.is=="string"?b.createElement("select",{is:i.is}):b.createElement("select"),i.multiple?c.multiple=!0:i.size&&(c.size=i.size);break;default:c=typeof i.is=="string"?b.createElement(o,{is:i.is}):b.createElement(o)}}c[Lt]=t,c[ln]=i;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)c.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=c;e:switch($t(c,o,i),o){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Ll(t)}}return yt(t),t.subtreeFlags&=-33554433,Bc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Ll(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(u(166));if(e=tn.current,br(t)){if(e=t.stateNode,l=t.memoizedProps,i=null,o=Ft,o!==null)switch(o.tag){case 27:case 5:i=o.memoizedProps}e[Lt]=t,e=!!(e.nodeValue===l||i!==null&&i.suppressHydrationWarning===!0||vg(e.nodeValue,l)),e||$l(t,!0)}else e=Va(e).createTextNode(i),e[Lt]=t,t.stateNode=e}return yt(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(i=br(t),l!==null){if(e===null){if(!i)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Lt]=t}else Di(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;yt(t),e=!1}else l=Zs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Sn(t),t):(Sn(t),null);if((t.flags&128)!==0)throw Error(u(558))}return yt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=br(t),i!==null&&i.dehydrated!==null){if(e===null){if(!o)throw Error(u(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(u(317));o[Lt]=t}else Di(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;yt(t),o=!1}else o=Zs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Sn(t),t):(Sn(t),null)}return Sn(t),(t.flags&128)!==0?(t.lanes=l,t):(l=i!==null,e=e!==null&&e.memoizedState!==null,l&&(i=t.child,o=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(o=i.alternate.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==o&&(i.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),oo(t,t.updateQueue),yt(t),null);case 4:return Me(),e===null&&vf(t.stateNode.containerInfo),t.flags|=67108864,yt(t),null;case 10:return Dl(t.type),yt(t),null;case 19:if(sc(t),i=t.memoizedState,i===null)return yt(t),null;if(o=(t.flags&128)!==0,c=i.rendering,c===null)if(o)za(i,!1);else{if(kt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Iu(e),c!==null){for(t.flags|=128,za(i,!1),e=c.updateQueue,t.updateQueue=e,oo(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Kh(l,e),l=l.sibling;return ja(t,Kt.current&1|2),Fe&&Al(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Nt()>wo&&(t.flags|=128,o=!0,za(i,!1),t.lanes=4194304)}else{if(!o)if(e=Iu(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,oo(t,e),za(i,!0),i.tail===null&&i.tailMode!=="collapsed"&&i.tailMode!=="visible"&&!c.alternate&&!Fe)return yt(t),null}else 2*Nt()-i.renderingStartTime>wo&&l!==536870912&&(t.flags|=128,o=!0,za(i,!1),t.lanes=4194304);i.isBackwards?(c.sibling=t.child,t.child=c):(e=i.last,e!==null?e.sibling=c:t.child=c,i.last=c)}if(i.tail!==null){e=i.tail;e:{for(l=e;l!==null;){if(l.alternate!==null){l=!1;break e}l=l.sibling}l=!0}return i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Nt(),e.sibling=null,c=Kt.current,c=o?c&1|2:c&1,i.tailMode==="visible"||i.tailMode==="collapsed"||!l||Fe?ja(t,c):(l=c,Je(It,t),Je(Kt,l),rn===null&&(rn=t)),Fe&&Al(t,i.treeForkCount),e}return yt(t),null;case 22:case 23:return Sn(t),uc(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(l&536870912)!==0&&(t.flags&128)===0&&(yt(t),t.subtreeFlags&6&&(t.flags|=8192)):yt(t),l=t.updateQueue,l!==null&&oo(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==l&&(t.flags|=2048),e!==null&&nt(Ui),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Dl(At),yt(t),null;case 25:return null;case 30:return t.flags|=33554432,yt(t),null}throw Error(u(156,t.tag))}function j1(e,t){switch(Is(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Dl(At),Me(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return lt(t),null;case 31:if(t.memoizedState!==null){if(Sn(t),t.alternate===null)throw Error(u(340));Di()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Sn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Di()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return sc(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Me(),null;case 10:return Dl(t.type),null;case 22:case 23:return Sn(t),uc(),e!==null&&nt(Ui),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Dl(At),null;case 25:return null;default:return null}}function kp(e,t){switch(Is(t),t.tag){case 3:Dl(At),Me();break;case 26:case 27:case 5:lt(t);break;case 4:Me();break;case 31:t.memoizedState!==null&&Sn(t);break;case 13:Sn(t);break;case 19:sc(t);break;case 10:Dl(t.type);break;case 22:case 23:Sn(t),uc(),e!==null&&nt(Ui);break;case 24:Dl(At)}}function Da(e,t){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var o=i.next;l=o;do{if((l.tag&e)===e){i=void 0;var c=l.create,b=l.inst;i=c(),b.destroy=i}l=l.next}while(l!==o)}}catch(k){ot(t,t.return,k)}}function ri(e,t,l){try{var i=t.updateQueue,o=i!==null?i.lastEffect:null;if(o!==null){var c=o.next;i=c;do{if((i.tag&e)===e){var b=i.inst,k=b.destroy;if(k!==void 0){b.destroy=void 0,o=t;var j=l,F=k;try{F()}catch(Z){ot(o,j,Z)}}}i=i.next}while(i!==c)}}catch(Z){ot(t,t.return,Z)}}function Sp(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{dm(t,l)}catch(i){ot(e,e.return,i)}}}function Np(e,t,l){l.props=Vi(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(i){ot(e,t,i)}}function cl(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:var o=e.stateNode,c=Cl(e.memoizedProps,o);(o.ref===null||o.ref.name!==c)&&(o.ref=zg(c)),i=o.ref;break;case 7:if(e.stateNode===null){var b=new Tn(e);g(e.child,!1,gv,b,void 0,void 0),e.stateNode=b}i=e.stateNode;break;default:i=e.stateNode}typeof l=="function"?e.refCleanup=l(i):l.current=i}}catch(k){ot(e,t,k)}}function Zt(e,t){var l=e.ref,i=e.refCleanup;if(l!==null)if(typeof i=="function")try{i()}catch(o){ot(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(o){ot(e,t,o)}else l.current=null}function so(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var l=0;l title"))),$t(i,t,l),i[Lt]=e,_t(i),t=i;break e;case"link":if(c=Kg("link","href",o).get(t+(l.href||""))){for(b=0;bBe&&(b=Be,Be=be,be=b);var q=Lh(k,be),O=Lh(k,Be);if(q&&O&&(X.rangeCount!==1||X.anchorNode!==q.node||X.anchorOffset!==q.offset||X.focusNode!==O.node||X.focusOffset!==O.offset)){var G=te.createRange();G.setStart(q.node,q.offset),X.removeAllRanges(),be>Be?(X.addRange(G),X.extend(O.node,O.offset)):(G.setEnd(O.node,O.offset),X.addRange(G))}}}}for(te=[],X=k;X=X.parentNode;)X.nodeType===1&&te.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;kl?32:l,pe.T=null,l=af,af=null;var c=Jn,b=gl;if(vt=0,Xi=Jn=null,gl=0,(tt&6)!==0)throw Error(u(331));var k=tt;if(tt|=4,Ip(c.current),Gp(c,c.current,b,l),tt=k,Ha(0,!1),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(pt,c)}catch{}return!0}finally{Se.p=o,pe.T=i,og(e,t)}}function sg(e,t,l){t=Ln(l,t),t=Tc(e.stateNode,t,2),e=ti(e,t,2),e!==null&&(Fl(e,2),xl(e))}function ot(e,t,l){if(e.tag===3)sg(e,e,l);else for(;t!==null;){if(t.tag===3){sg(t,e,l);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(si===null||!si.has(i))){e=Ln(l,e),l=rp(2),i=ti(t,l,2),i!==null&&(ap(l,i,t,e),Fl(i,2),xl(i));break}}t=t.return}}function hf(e,t,l){var i=e.pingCache;if(i===null){i=e.pingCache=new A1;var o=new Set;i.set(t,o)}else o=i.get(t),o===void 0&&(o=new Set,i.set(t,o));o.has(l)||(nf=!0,o.add(l),e=B1.bind(null,e,t,l),t.then(e,e))}function B1(e,t,l){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,dt===e&&(Ze&l)===l&&((kt===4||kt===3&&(Ze&62914560)===Ze&&300>Nt()-vo)&&(tt&2)===0?Lr(e,0):bo|=l,zr===Ze&&(zr=0)),xl(e)}function cg(e,t){t===0&&(t=hu()),e=Ai(e,t),e!==null&&(Fl(e,t),xl(e))}function H1(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),cg(e,l)}function q1(e,t){var l=0;switch(e.tag){case 31:case 13:var i=e.stateNode,o=e.memoizedState;o!==null&&(l=o.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(u(314))}i!==null&&i.delete(t),cg(e,l)}function F1(e,t){return zn(e,t)}var Br=null,Hr=null,mf=!1,To=!1,pf=!1,fi=0;function xl(e){e!==Hr&&e.next===null&&(Hr===null?Br=Hr=e:Hr=Hr.next=e),To=!0,mf||(mf=!0,Y1())}function Ha(e,t){if(!pf&&To){pf=!0;do for(var l=!1,i=Br;i!==null;){if(e!==0){var o=i.pendingLanes;if(o===0)var c=0;else{var b=i.suspendedLanes,k=i.pingedLanes;c=(1<<31-Ke(42|e)+1)-1,c&=o&~(b&~k),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(l=!0,mg(i,c))}else c=Ze,c=ir(i,i===dt?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(c&3)===0||kl(i,c)||(l=!0,mg(i,c));i=i.next}while(l);pf=!1}}function V1(){fg()}function fg(){To=mf=!1;var e=0;fi!==0&&ev()&&(e=fi);for(var t=Nt(),l=null,i=Br;i!==null;){var o=i.next,c=dg(i,t);c===0?(i.next=null,l===null?Br=o:l.next=o,o===null&&(Hr=l)):(l=i,(e!==0||(c&3)!==0)&&(To=!0)),i=o}vt!==0&&vt!==5||Ha(e),fi!==0&&(fi=0)}function dg(e,t){for(var l=e.suspendedLanes,i=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0k)break;var Z=j.transferSize,te=j.initiatorType;Z&&wg(te)&&(j=j.responseEnd,b+=Z*(jMo){be.length=me;break}G=new Promise(av.bind(G)),be.push(G)}}}if(0"u"?null:document;function Gg(e,t,l){var i=Fr;if(i&&typeof t=="string"&&t){var o=Oe(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof l=="string"&&(o+='[crossorigin="'+l+'"]'),Yg.has(o)||(Yg.add(o),e={rel:e,crossOrigin:l,href:t},i.querySelector(o)===null&&(t=i.createElement("link"),$t(t,"link",e),_t(t),i.head.appendChild(t)))}}function Ev(e){Bl.D(e),Gg("dns-prefetch",e,null)}function jv(e,t){Bl.C(e,t),Gg("preconnect",e,t)}function Cv(e,t,l){Bl.L(e,t,l);var i=Fr;if(i&&e&&t){var o='link[rel="preload"][as="'+Oe(t)+'"]';t==="image"&&l&&l.imageSrcSet?(o+='[imagesrcset="'+Oe(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(o+='[imagesizes="'+Oe(l.imageSizes)+'"]')):o+='[href="'+Oe(e)+'"]';var c=o;switch(t){case"style":c=Vr(e);break;case"script":c=Yr(e)}if(!(Vn.has(c)||(e=R({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Vn.set(c,e),i.querySelector(o)!==null||t==="style"&&i.querySelector(Ga(c))||t==="script"&&i.querySelector(Qa(c))))){var b=i.createElement("link");$t(b,"link",e),t==="style"&&(b[rr]=!0,b.onload=b.onerror=function(){yu(b)}),_t(b),i.head.appendChild(b)}}}function Tv(e,t){Bl.m(e,t);var l=Fr;if(l&&e){var i=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Oe(i)+'"][href="'+Oe(e)+'"]',c=o;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Yr(e)}if(!Vn.has(c)&&(e=R({rel:"modulepreload",href:e},t),Vn.set(c,e),l.querySelector(o)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Qa(c)))return}i=l.createElement("link"),$t(i,"link",e),_t(i),l.head.appendChild(i)}}}function _v(e,t,l){Bl.S(e,t,l);var i=Fr;if(i&&e){var o=Gl(i).hoistableStyles,c=Vr(e);t=t||"default";var b=o.get(c);if(!b){var k={loading:0,preload:null};if(b=i.querySelector(Ga(c)))k.loading=5;else{e=R({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Vn.get(c))&&Lf(e,l);var j=b=i.createElement("link");_t(j),$t(j,"link",e),j._p=new Promise(function(F,Z){j.onload=F,j.onerror=Z}),j.addEventListener("load",function(){k.loading|=1}),j.addEventListener("error",function(){k.loading|=2}),k.loading|=4,zo(b,t,i)}b={type:"stylesheet",instance:b,count:1,state:k},o.set(c,b)}}}function Av(e,t){Bl.X(e,t);var l=Fr;if(l&&e){var i=Gl(l).hoistableScripts,o=Yr(e),c=i.get(o);c||(c=l.querySelector(Qa(o)),c||(e=R({src:e,async:!0},t),(t=Vn.get(o))&&Uf(e,t),c=l.createElement("script"),_t(c),$t(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(o,c))}}function zv(e,t){Bl.M(e,t);var l=Fr;if(l&&e){var i=Gl(l).hoistableScripts,o=Yr(e),c=i.get(o);c||(c=l.querySelector(Qa(o)),c||(e=R({src:e,async:!0,type:"module"},t),(t=Vn.get(o))&&Uf(e,t),c=l.createElement("script"),_t(c),$t(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(o,c))}}function Qg(e,t,l,i){var o=(o=tn.current)?Ya(o):null;if(!o)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(l=Vr(l.href),t=Gl(o).hoistableStyles,i=t.get(l),i||(i={type:"style",instance:null,count:0,state:null},t.set(l,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Vr(l.href);var c=Gl(o).hoistableStyles,b=c.get(e);if(b||(o=o.ownerDocument||o,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,b),(c=o.querySelector(Ga(e)))?c._p||(b.instance=c,b.state.loading=5):(c=Vn.get(e),c||(c={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Vn.set(e,c)),Dv(o,e,c,b.state))),t&&i===null)throw Error(u(528,""));return b}if(t&&i!==null)throw Error(u(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(l=Yr(l),t=Gl(o).hoistableScripts,i=t.get(l),i||(i={type:"script",instance:null,count:0,state:null},t.set(l,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Vr(e){return'href="'+Oe(e)+'"'}function Ga(e){return'link[rel="stylesheet"]['+e+"]"}function Xg(e){return R({},e,{"data-precedence":e.precedence,precedence:null})}function Dv(e,t,l,i){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[rr]!==!0){i.loading=1;return}}else t=e.createElement("link"),t[rr]=!0,t.onload=t.onerror=yu.bind(null,t),$t(t,"link",l),_t(t),e.head.appendChild(t);i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2})}function Yr(e){return'[src="'+Oe(e)+'"]'}function Qa(e){return"script[async]"+e}function Ig(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Oe(l.href)+'"]');if(i)return t.instance=i,_t(i),i;var o=R({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),_t(i),$t(i,"style",o),zo(i,l.precedence,e),t.instance=i;case"stylesheet":o=Vr(l.href);var c=e.querySelector(Ga(o));if(c)return t.state.loading|=4,t.instance=c,_t(c),c;i=Xg(l),(o=Vn.get(o))&&Lf(i,o),c=(e.ownerDocument||e).createElement("link"),_t(c);var b=c;return b._p=new Promise(function(k,j){b.onload=k,b.onerror=j}),$t(c,"link",i),t.state.loading|=4,zo(c,l.precedence,e),t.instance=c;case"script":return c=Yr(l.src),(o=e.querySelector(Qa(c)))?(t.instance=o,_t(o),o):(i=l,(o=Vn.get(c))&&(i=R({},l),Uf(i,o)),e=e.ownerDocument||e,o=e.createElement("script"),_t(o),$t(o,"link",i),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,zo(i,l.precedence,e));return t.instance}function zo(e,t,l){for(var i=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=i.length?i[i.length-1]:null,c=o,b=0;b title"):null)}function Mv(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Zg(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function $g(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Jg(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Pg(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=Jg(t),e.suspenseyImages.push(t)),e=Lv.bind(e),t.decode().then(e,e))}function Ov(e,t,l,i){if(l.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var o=Vr(i.href),c=t.querySelector(Ga(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Xa.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=c,_t(c);return}c=t.ownerDocument||t,i=Xg(i),(o=Vn.get(o))&&Lf(i,o),c=c.createElement("link"),_t(c);var b=c;b._p=new Promise(function(k,j){b.onload=k,b.onerror=j}),$t(c,"link",i),l.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Xa.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Mo=0;function Rv(e,t){return e.stylesheets&&e.count===0&&Ro(e,e.stylesheets),0Mo?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(o)}}:null}function Wg(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Ro(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Xa(){this.count--,Wg(this)}function Lv(){this.imgCount--,Wg(this)}var Oo=null;function Ro(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Oo=new Map,t.forEach(Uv,e),Oo=null,Xa.call(e))}function Uv(e,t){if(!(t.state.loading&4)){var l=Oo.get(e);if(l)var i=l.get(null);else{l=new Map,Oo.set(e,l);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Kf.exports=t2(),Kf.exports}var l2=n2();const i2=Hd(l2);class r2 extends Error{constructor(a,u){super(a);Qf(this,"status");this.name="ApiError",this.status=u}}async function Fd(n,r){let a=r;try{const u=await n.json();u!=null&&u.detail&&(a=u.detail)}catch{}return new r2(a,n.status)}async function a2(n){const r=await fetch(`/api/notifications?after=${n}`);if(!r.ok)throw new Error("Failed to fetch notifications");return r.json()}async function u2(){const n=await fetch("/api/actions/open-log",{method:"POST"});if(!n.ok)throw new Error("Failed to open log file");return n.json()}async function o2(n){const r=new URLSearchParams;r.set("limit",String(n.limit)),n!=null&&n.level&&r.set("level",n.level),n!=null&&n.search&&r.set("search",n.search);const a=await fetch(`/api/logs?${r.toString()}`);if(!a.ok)throw new Error("Failed to fetch log entries");return a.json()}async function Po(){const n=await fetch("/api/system");if(!n.ok)throw new Error("Failed to fetch system info");return n.json()}async function s2(n){const r=await fetch("/api/system/bind",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lan:n})});if(!r.ok){let a="Failed to update LAN binding";try{const u=await r.json();u!=null&&u.detail&&(a=u.detail)}catch{}throw new Error(a)}return r.json()}async function c2(n,r=1e4){const a=Date.now()+r;let u=null;for(;Date.now()setTimeout(s,500))}return u}async function Sx(){const n=await fetch("/api/config");if(!n.ok)throw new Error("Failed to fetch app configuration");return n.json()}async function Nx(n){const r=await fetch("/api/config/select-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({directory:n})});if(!r.ok)throw new Error("Failed to select directory");return r.json()}async function f2(n){const r=await fetch("/api/config/load",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config_path:n})});if(!r.ok)throw new Error("Failed to load config file");return r.json()}async function d2(n,r){const a=await fetch("/api/config/load-content",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:n,content:r})});if(!a.ok){let u=`Failed to apply dropped config (${n})`;try{const s=await a.json();s!=null&&s.detail&&(u=s.detail)}catch{}throw new Error(u)}return a.json()}async function h2(){const n=await fetch("/api/config/reload",{method:"POST"});if(!n.ok){let r="Failed to reload configuration";try{const a=await n.json();a!=null&&a.detail&&(r=a.detail)}catch{}throw new Error(r)}return n.json()}async function m2(n){const r=await fetch("/api/config/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({directory:n})});if(!r.ok)throw new Error("Failed to create config file");return r.json()}async function p2(n){const r=`/api/fs/browse?path=${encodeURIComponent(n)}&include_hidden=true`,a=await fetch(r);if(!a.ok)throw new Error("Failed to browse config files");return a.json()}async function g2(n){const r=`/api/fs/browse?path=${encodeURIComponent(n)}`,a=await fetch(r);if(!a.ok)throw new Error("Failed to browse directory");return a.json()}async function Ex(n,r){const a=await fetch("/api/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:r});if(!a.ok)throw new Error("Failed to execute scan");return a.json()}async function Pf(n){const r=new URLSearchParams;(n==null?void 0:n.offset)!=null&&r.set("offset",String(n.offset)),(n==null?void 0:n.limit)!=null&&r.set("limit",String(n.limit)),n!=null&&n.sort_by&&r.set("sort_by",n.sort_by),n!=null&&n.sort_dir&&r.set("sort_dir",n.sort_dir);const a=r.toString(),u=`/api/scan/results${a?`?${a}`:""}`,s=await fetch(u,{signal:n==null?void 0:n.signal});if(!s.ok)throw new Error("Failed to fetch scan results");return s.json()}async function x2(n){const r=await fetch("/api/actions/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error("Failed to launch file");return r.json()}async function Yy(n){const r=await fetch("/api/actions/reveal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n})});if(!r.ok)throw new Error("Failed to reveal file");return r.json()}async function yd(n){const r=await fetch("/api/actions/open-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n})});if(!r.ok)throw new Error("Failed to open folder");return r.json()}async function jx(n){const r=await fetch("/api/actions/open-terminal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n})});if(!r.ok)throw new Error("Failed to open terminal");return r.json()}async function Cx(n,r){const a=await fetch("/api/actions/hash",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n,algorithm:r})});if(!a.ok)throw new Error("Failed to compute hash");return a.json()}async function Tx(){const n=await fetch("/api/actions/open-config",{method:"POST"});if(!n.ok)throw new Error("Failed to open config file");return n.json()}async function _x(n){const r={file_path:n.file_path||n.filePath,content:n.content},a=await fetch("/api/actions/barcode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw new Error("Failed to generate barcode");return a.json()}async function y2(n){const r=await fetch("/api/actions/barcode/decode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image_base64:n.imageBase64,formats:n.formats})});if(!r.ok)throw r.status===503?new Error("Server-side barcode decoding is unavailable"):new Error(`Failed to decode frame (HTTP ${r.status})`);return r.json()}async function b2(n,r){const a=await fetch("/api/actions/metadata",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n}),signal:r});if(!a.ok)throw new Error("Failed to fetch metadata");return a.json()}async function v2(n,r){const a=await fetch("/api/actions/export-csv",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n,filename:r})});if(!a.ok)throw new Error("Failed to export CSV");return a.json()}async function w2(n,r){const a=await fetch("/api/actions/save-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image_base64:n,filename:r})});if(!a.ok)throw new Error("Failed to save image");return a.json()}async function k2(n){const r=await fetch("/api/workflow/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw await Fd(r,"Failed to start workflow session");return r.json()}async function S2(n,r){const a=await fetch(`/api/workflow/${n}/respond`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:r})});if(!a.ok)throw await Fd(a,"Failed to respond to workflow prompt");return a.json()}async function N2(n){const r=await fetch(`/api/workflow/${n}/abort`,{method:"POST"});if(!r.ok)throw await Fd(r,"Failed to abort workflow session");return r.json()}const E2=[".profiles",".profiles.yaml",".profiles.yml",".yaml",".yml"];function j2(n){const r=n.toLowerCase();return E2.some(a=>r.endsWith(a))}function C2(n){for(const r of n)if(j2(r.name))return r;return null}function Wo(){return{depth:0,overlayVisible:!1}}function Ax(n,r,a){switch(r){case"enter":return a?{depth:n.depth+1,overlayVisible:!0}:n;case"leave":{const u=Math.max(0,n.depth-1);return{depth:u,overlayVisible:n.depth>0&&u>0}}case"drop":return Wo()}}function zx(n){return n==="light"?"light":"dark"}/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const C2=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gy=(...n)=>n.filter((r,a,u)=>!!r&&r.trim()!==""&&u.indexOf(r)===a).join(" ").trim();/** + */const T2=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gy=(...n)=>n.filter((r,a,u)=>!!r&&r.trim()!==""&&u.indexOf(r)===a).join(" ").trim();/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var T2={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"};/** + */var _2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _2=_.forwardRef(({color:n="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:u,className:s="",children:d,iconNode:f,...m},p)=>_.createElement("svg",{ref:p,...T2,width:r,height:r,stroke:n,strokeWidth:u?Number(a)*24/Number(r):a,className:Gy("lucide",s),...m},[...f.map(([x,y])=>_.createElement(x,y)),...Array.isArray(d)?d:[d]]));/** + */const A2=_.forwardRef(({color:n="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:u,className:s="",children:d,iconNode:f,...m},p)=>_.createElement("svg",{ref:p,..._2,width:r,height:r,stroke:n,strokeWidth:u?Number(a)*24/Number(r):a,className:Gy("lucide",s),...m},[...f.map(([x,y])=>_.createElement(x,y)),...Array.isArray(d)?d:[d]]));/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ee=(n,r)=>{const a=_.forwardRef(({className:u,...s},d)=>_.createElement(_2,{ref:d,iconNode:r,className:Gy(`lucide-${C2(n)}`,u),...s}));return a.displayName=`${n}`,a};/** + */const Ee=(n,r)=>{const a=_.forwardRef(({className:u,...s},d)=>_.createElement(A2,{ref:d,iconNode:r,className:Gy(`lucide-${T2(n)}`,u),...s}));return a.displayName=`${n}`,a};/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const A2=[["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"}]],z2=Ee("Activity",A2);/** + */const z2=[["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"}]],D2=Ee("Activity",z2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const D2=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Qy=Ee("ArrowDown",D2);/** + */const M2=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Qy=Ee("ArrowDown",M2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const M2=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],O2=Ee("ArrowLeftRight",M2);/** + */const O2=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],R2=Ee("ArrowLeftRight",O2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const R2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],L2=Ee("ArrowRight",R2);/** + */const L2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],U2=Ee("ArrowRight",L2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const U2=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],Dx=Ee("ArrowUpDown",U2);/** + */const B2=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],Dx=Ee("ArrowUpDown",B2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const B2=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],H2=Ee("ArrowUp",B2);/** + */const H2=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],q2=Ee("ArrowUp",H2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const q2=[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]],F2=Ee("Bug",q2);/** + */const F2=[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]],V2=Ee("Bug",F2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const V2=[["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"}]],Y2=Ee("Calendar",V2);/** + */const Y2=[["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"}]],G2=Ee("Calendar",Y2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const G2=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],Xy=Ee("Camera",G2);/** + */const Q2=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],Xy=Ee("Camera",Q2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Q2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vi=Ee("Check",Q2);/** + */const X2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vi=Ee("Check",X2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const X2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],I2=Ee("ChevronDown",X2);/** + */const I2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],K2=Ee("ChevronDown",I2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const K2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Vd=Ee("ChevronRight",K2);/** + */const Z2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Vd=Ee("ChevronRight",Z2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Z2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],lu=Ee("CircleAlert",Z2);/** + */const $2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],lu=Ee("CircleAlert",$2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Mx=Ee("CircleCheck",$2);/** + */const J2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Mx=Ee("CircleCheck",J2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const J2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],P2=Ee("CirclePause",J2);/** + */const P2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],W2=Ee("CirclePause",P2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const W2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]],ew=Ee("CirclePlay",W2);/** + */const ew=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]],tw=Ee("CirclePlay",ew);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],bd=Ee("CircleX",tw);/** + */const nw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],bd=Ee("CircleX",nw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],lw=Ee("Clock",nw);/** + */const lw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],iw=Ee("Clock",lw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const iw=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],An=Ee("Copy",iw);/** + */const rw=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],An=Ee("Copy",rw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const rw=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Iy=Ee("Download",rw);/** + */const aw=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Iy=Ee("Download",aw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aw=[["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"}]],uw=Ee("ExternalLink",aw);/** + */const uw=[["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"}]],ow=Ee("ExternalLink",uw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ow=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],sw=Ee("EyeOff",ow);/** + */const sw=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],cw=Ee("EyeOff",sw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cw=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],vd=Ee("Eye",cw);/** + */const fw=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],vd=Ee("Eye",fw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fw=[["polygon",{points:"13 19 22 12 13 5 13 19",key:"587y9g"}],["polygon",{points:"2 19 11 12 2 5 2 19",key:"3pweh0"}]],dw=Ee("FastForward",fw);/** + */const dw=[["polygon",{points:"13 19 22 12 13 5 13 19",key:"587y9g"}],["polygon",{points:"2 19 11 12 2 5 2 19",key:"3pweh0"}]],hw=Ee("FastForward",dw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const hw=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],wd=Ee("FileCode",hw);/** + */const mw=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],wd=Ee("FileCode",mw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mw=[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m3.2 12.9-.9-.4",key:"1i3dj5"}],["path",{d:"m3.2 15.1-.9.4",key:"1fvgj0"}],["path",{d:"M4.677 21.5a2 2 0 0 0 1.313.5H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2.5",key:"1yo3oz"}],["path",{d:"m4.9 11.2-.4-.9",key:"otmhb9"}],["path",{d:"m4.9 16.8-.4.9",key:"1b8z07"}],["path",{d:"m7.5 10.3-.4.9",key:"11k65u"}],["path",{d:"m7.5 17.7-.4-.9",key:"431x55"}],["path",{d:"m9.7 12.5-.9.4",key:"87sjan"}],["path",{d:"m9.7 15.5-.9-.4",key:"khqm91"}],["circle",{cx:"6",cy:"14",r:"3",key:"a1xfv6"}]],Kr=Ee("FileCog",mw);/** + */const pw=[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m3.2 12.9-.9-.4",key:"1i3dj5"}],["path",{d:"m3.2 15.1-.9.4",key:"1fvgj0"}],["path",{d:"M4.677 21.5a2 2 0 0 0 1.313.5H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2.5",key:"1yo3oz"}],["path",{d:"m4.9 11.2-.4-.9",key:"otmhb9"}],["path",{d:"m4.9 16.8-.4.9",key:"1b8z07"}],["path",{d:"m7.5 10.3-.4.9",key:"11k65u"}],["path",{d:"m7.5 17.7-.4-.9",key:"431x55"}],["path",{d:"m9.7 12.5-.9.4",key:"87sjan"}],["path",{d:"m9.7 15.5-.9-.4",key:"khqm91"}],["circle",{cx:"6",cy:"14",r:"3",key:"a1xfv6"}]],Kr=Ee("FileCog",pw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pw=[["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"}]],Pr=Ee("FileText",pw);/** + */const gw=[["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"}]],Pr=Ee("FileText",gw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gw=[["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"}]],Wf=Ee("File",gw);/** + */const xw=[["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"}]],Wf=Ee("File",xw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xw=[["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"}]],Ji=Ee("FolderOpen",xw);/** + */const yw=[["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"}]],Ji=Ee("FolderOpen",yw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yw=[["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"}]],ss=Ee("Folder",yw);/** + */const bw=[["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"}]],ss=Ee("Folder",bw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],vw=Ee("Globe",bw);/** + */const vw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],ww=Ee("Globe",vw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ww=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Zr=Ee("Hash",ww);/** + */const kw=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Zr=Ee("Hash",kw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kw=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],Yd=Ee("House",kw);/** + */const Sw=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],Yd=Ee("House",Sw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Sw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ky=Ee("Info",Sw);/** + */const Nw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ky=Ee("Info",Nw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Nw=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],Zy=Ee("Keyboard",Nw);/** + */const Ew=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],Zy=Ee("Keyboard",Ew);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ew=[["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"}]],jw=Ee("Link2",Ew);/** + */const jw=[["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"}]],Cw=Ee("Link2",jw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cw=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Wi=Ee("LoaderCircle",Cw);/** + */const Tw=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Wi=Ee("LoaderCircle",Tw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Tw=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],_w=Ee("Lock",Tw);/** + */const _w=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Aw=Ee("Lock",_w);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Aw=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],zw=Ee("Moon",Aw);/** + */const zw=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Dw=Ee("Moon",zw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Dw=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],Mw=Ee("Network",Dw);/** + */const Mw=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],Ow=Ee("Network",Mw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ow=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],er=Ee("Play",Ow);/** + */const Rw=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],er=Ee("Play",Rw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Rw=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Lw=Ee("Plus",Rw);/** + */const Lw=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Uw=Ee("Plus",Lw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Uw=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],Gd=Ee("QrCode",Uw);/** + */const Bw=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],Gd=Ee("QrCode",Bw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Bw=[["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"}]],cs=Ee("RefreshCw",Bw);/** + */const Hw=[["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"}]],cs=Ee("RefreshCw",Hw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Hw=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],qw=Ee("Rocket",Hw);/** + */const qw=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],Fw=Ee("Rocket",qw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Fw=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],$y=Ee("Search",Fw);/** + */const Vw=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],$y=Ee("Search",Vw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Vw=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Yw=Ee("Settings",Vw);/** + */const Yw=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Gw=Ee("Settings",Yw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Gw=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Qw=Ee("Sun",Gw);/** + */const Qw=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Xw=Ee("Sun",Qw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Xw=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],kd=Ee("Terminal",Xw);/** + */const Iw=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],kd=Ee("Terminal",Iw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Iw=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],Jy=Ee("Timer",Iw);/** + */const Kw=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],Jy=Ee("Timer",Kw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Kw=[["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"}]],Py=Ee("Trash2",Kw);/** + */const Zw=[["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"}]],Py=Ee("Trash2",Zw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Zw=[["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"}]],Wy=Ee("TriangleAlert",Zw);/** + */const $w=[["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"}]],Wy=Ee("TriangleAlert",$w);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $w=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Jw=Ee("User",$w);/** + */const Jw=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Pw=Ee("User",Jw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Pw=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],eb=Ee("Webhook",Pw);/** + */const Ww=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],eb=Ee("Webhook",Ww);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ww=[["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"}]],ek=Ee("Workflow",Ww);/** + */const ek=[["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"}]],tk=Ee("Workflow",ek);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tk=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],nl=Ee("X",tk);function nk(n){if(n<60)return`${n}s`;const r=Math.floor(n/60),a=n%60;return`${r}m${a.toString().padStart(2,"0")}s`}function lk(n){if(!n)return{label:"",cut:!1};const r=n.replace(/\\/g,"/").split("/").filter(Boolean);return r.length===0?{label:n,cut:!1}:{label:r[r.length-1],cut:r.length>1}}function ik({directory:n}){const[r,a]=_.useState(0);_.useEffect(()=>{a(0);const d=window.setInterval(()=>{a(f=>f+1)},1e3);return()=>window.clearInterval(d)},[]);const{label:u,cut:s}=lk(n);return h.jsxs("div",{"data-testid":"scan-status-strip",className:"flex min-w-0 items-center gap-1.5 text-[11px] text-ink-muted",children:[h.jsx(Wi,{className:"h-3 w-3 shrink-0 animate-spin text-chip-indigo-text motion-reduce:animate-none","aria-hidden":"true"}),h.jsxs("span",{className:"min-w-0 truncate",children:["Scanning",n&&h.jsxs(h.Fragment,{children:[" ",h.jsxs("span",{className:"font-mono text-ink-secondary",title:n,children:[s?"…/":"",u]})]})," — ",h.jsx("span",{className:"font-mono tabular-nums text-ink-secondary",children:nk(r)})]})]})}function rk({onExecute:n,scanning:r,hasSelection:a,fileCount:u,totalCount:s,scanningDirectory:d="",toastMessage:f,onToastDismiss:m}){const p=(f==null?void 0:f.kind)==="error";return h.jsxs("div",{className:"relative flex items-center justify-between border-t border-line bg-surface-glass px-4 py-2.5 text-xs transition-colors duration-200",children:[f&&h.jsx("div",{role:"status","aria-live":p?"assertive":"polite","aria-atomic":"true",className:`animate-toast-in absolute left-1/2 top-1/2 z-[var(--z-toast)] max-w-[min(80vw,640px)] -translate-x-1/2 -translate-y-1/2 rounded-xl border px-4 py-2 text-xs font-medium glass-panel-strong ${p?"pointer-events-auto flex max-w-[min(70vw,560px)] items-center gap-2.5 border-status-danger-border text-left text-ink":"pointer-events-none max-w-[min(70vw,560px)] text-center text-ink"}`,children:p?h.jsxs(h.Fragment,{children:[h.jsx(bd,{className:"h-3.5 w-3.5 shrink-0 text-status-danger-text/80","aria-hidden":"true"}),h.jsx("span",{className:"min-w-0 flex-1",children:f.message}),m&&h.jsx("button",{type:"button",onClick:m,"aria-label":"Dismiss error",className:"shrink-0 rounded-md p-0.5 text-status-danger-text/60 hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-status-danger-border transition-colors",children:h.jsx(nl,{className:"h-3.5 w-3.5"})})]}):f.message}),h.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[r&&h.jsx(ik,{directory:d}),s!==void 0&&s!==u&&h.jsxs("span",{"data-testid":"action-bar-count",className:"text-ink-muted",children:["Showing ",u," of ",s]})]}),h.jsxs("button",{onClick:n,disabled:!a||r,className:"flex shrink-0 items-center gap-2 rounded-xl border border-emerald-300/50 bg-gradient-to-b from-emerald-400/90 to-emerald-600/90 px-5 py-2 font-semibold text-white shadow-[inset_0_1px_0_rgb(255_255_255/0.35),0_8px_24px_-6px_rgb(16_185_129/0.55)] transition-[filter,box-shadow,transform] hover:-translate-y-px hover:brightness-110 hover:shadow-[inset_0_1px_0_rgb(255_255_255/0.35),0_12px_30px_-6px_rgb(16_185_129/0.7)] disabled:opacity-40 disabled:hover:translate-y-0 disabled:hover:brightness-100 disabled:hover:shadow-[inset_0_1px_0_rgb(255_255_255/0.35),0_8px_24px_-6px_rgb(16_185_129/0.55)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400",children:[h.jsx(er,{className:"h-3.5 w-3.5 fill-current"}),h.jsx("span",{children:"Execute"}),h.jsx("kbd",{className:"rounded bg-emerald-800/60 px-1.5 py-0.5 text-[10px] text-emerald-200 shadow-[inset_0_1px_0_rgb(255_255_255/0.12)]",children:"↵"})]})]})}function ak({position:n,onClose:r,onLaunch:a,onLaunchWithArgs:u,onReveal:s,onOpenFolder:d,onOpenTerminal:f,onScanDirectory:m,onFilterFolder:p,onFilterExtension:x,onCopyPath:y,onCopyFilename:g,onCopyUri:w,onComputeHash:v,onVerifyHash:S,onProperties:C,onClearFile:L,onGenerateBarcode:z,showToast:$}){const[I,J]=_.useState(!1),[ie,U]=_.useState(""),R=_.useRef(null),Q=_.useRef(null),fe=_.useRef(null),[B,ne]=_.useState(null);if(_.useEffect(()=>{var re;I&&((re=Q.current)==null||re.showModal())},[I]),_.useLayoutEffect(()=>{if(!n){ne(null);return}const re=()=>{const N=R.current;if(!N)return;const qe=N.getBoundingClientRect(),Ge=8;ne({left:Math.max(Ge,Math.min(n.x,window.innerWidth-qe.width-Ge)),top:Math.max(Ge,Math.min(n.y,window.innerHeight-qe.height-Ge))})};return re(),window.addEventListener("resize",re),()=>window.removeEventListener("resize",re)},[n]),_.useEffect(()=>{if(!n)return;fe.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const re=window.requestAnimationFrame(()=>{var N,qe;(qe=(N=R.current)==null?void 0:N.querySelector("[role='menuitem']"))==null||qe.focus()});return()=>{var N;window.cancelAnimationFrame(re),(N=fe.current)==null||N.focus()}},[n]),!n)return null;const{file:V,x:se,y:ve}=n,ae=()=>{u(V,ie),J(!1),r()},A=re=>{const N=re.lastIndexOf(".");return N!==-1?re.slice(N):""},W=re=>{const N=Math.max(re.lastIndexOf("/"),re.lastIndexOf("\\"));return N!==-1?re.slice(0,N):re},le=re=>{const N=Math.max(re.lastIndexOf("/"),re.lastIndexOf("\\"));return N!==-1?re.slice(0,N):""};return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 z-[calc(var(--z-context-menu)-1)]",onClick:r,onContextMenu:re=>{re.preventDefault(),r()},"aria-hidden":"true"}),h.jsxs("div",{ref:R,role:"menu","aria-label":`Actions for ${V.filename}`,tabIndex:0,onKeyDown:re=>{var Ge,M,E,Y;["Escape","ArrowDown","ArrowUp","Home","End"].includes(re.key)&&re.stopPropagation();const N=Array.from(((Ge=R.current)==null?void 0:Ge.querySelectorAll("[role='menuitem']"))??[]),qe=N.indexOf(document.activeElement);if(re.key==="Escape")re.preventDefault(),r();else if(re.key==="ArrowDown"||re.key==="ArrowUp"){re.preventDefault();const oe=re.key==="ArrowDown"?1:-1;(M=N[(qe+oe+N.length)%N.length])==null||M.focus()}else re.key==="Home"?(re.preventDefault(),(E=N[0])==null||E.focus()):re.key==="End"&&(re.preventDefault(),(Y=N.at(-1))==null||Y.focus())},className:"animate-modal-in fixed z-[var(--z-context-menu)] max-h-[calc(100dvh-16px)] w-56 max-w-[calc(100vw-16px)] overflow-y-auto rounded-lg border border-line bg-surface-glass py-1 text-xs text-ink shadow-2xl backdrop-blur-md",style:B??{left:se,top:ve,visibility:"hidden"},children:[h.jsx("div",{className:"border-b border-line px-3 py-2 font-medium text-ink-muted truncate",children:V.filename}),h.jsxs("button",{role:"menuitem",onClick:()=>{a(V),r()},className:"flex w-full items-center gap-2 px-3 py-3 min-h-[44px] hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Launch ${V.filename}`,children:[h.jsx(er,{className:"h-3.5 w-3.5 fill-current text-status-success-text group-hover:text-white"}),h.jsx("span",{children:"Launch"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{J(!0)},className:"flex w-full items-center gap-2 px-3 py-3 min-h-[44px] hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Launch ${V.filename} with arguments`,children:[h.jsx(er,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Launch with arguments..."})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{s(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Reveal ${V.filename} in file manager`,children:[h.jsx(vd,{className:"h-3.5 w-3.5 text-chip-sky-text group-hover:text-white"}),h.jsx("span",{children:"Reveal in File Manager"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{d(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Open folder containing ${V.filename}`,children:[h.jsx(Ji,{className:"h-3.5 w-3.5 text-chip-amber-text group-hover:text-white"}),h.jsx("span",{children:"Open Folder"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{f(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Open terminal in directory containing ${V.filename}`,children:[h.jsx(kd,{className:"h-3.5 w-3.5 text-status-success-text group-hover:text-white"}),h.jsx("span",{children:"Open Terminal in Directory"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{z(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":"Generate QR Code",children:[h.jsx(Gd,{className:"h-3.5 w-3.5 text-chip-fuchsia-text group-hover:text-white"}),h.jsx("span",{children:"Generate QR Code"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{const re=W(V.path);m(re),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":"Scan to Directory",children:[h.jsx(Ji,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Scan to Directory"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{const re=le(V.rel_path);re&&p(re),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Filter view to folder ${V.filename} is in`,children:[h.jsx(wd,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Filter to Folder"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{const re=A(V.filename);re&&x(re),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Filter view by extension ${A(V.filename)}`,children:[h.jsx(wd,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Filter by Extension"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{y(V,!1),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy full path of ${V.filename}`,children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Full Path"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{y(V,!0),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy path of ${V.filename} with forward slashes`,children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Path (Forward Slashes)"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{g(V,!1),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy filename of ${V.filename}`,children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Filename"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{g(V,!0),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy filename of ${V.filename} without extension`,children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Filename (no ext)"})]}),h.jsxs("button",{role:"menuitem",onClick:async()=>{const re=W(V.path);r();try{await navigator.clipboard.writeText(re),$==null||$(`Copied: ${re}`)}catch(N){$==null||$(`Copy failed: ${(N==null?void 0:N.message)??N}`,"error")}},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":"Copy Directory",children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Directory"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{w(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy URI of ${V.filename}`,children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy URI"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{v(V,"md5"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Compute MD5 hash of ${V.filename}`,children:[h.jsx(Zr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Compute MD5 Hash"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{v(V,"sha256"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Compute SHA256 hash of ${V.filename}`,children:[h.jsx(Zr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Compute SHA256 Hash"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{S(V,"md5"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Verify MD5 hash of ${V.filename}`,children:[h.jsx(Zr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Verify MD5 Hash"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{S(V,"sha256"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Verify SHA256 hash of ${V.filename}`,children:[h.jsx(Zr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Verify SHA256 Hash"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{C(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`View properties of ${V.filename}`,children:[h.jsx(vd,{className:"h-3.5 w-3.5 text-chip-sky-text group-hover:text-white"}),h.jsx("span",{children:"Properties"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{L(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Remove ${V.filename} from list`,children:[h.jsx(Py,{className:"h-3.5 w-3.5 text-status-danger-text group-hover:text-white"}),h.jsx("span",{children:"Delete"})]})]}),I&&h.jsx("dialog",{ref:Q,className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 rounded-xl","aria-labelledby":"args-modal-title",onClick:re=>{re.target===Q.current&&J(!1)},onCancel:re=>{re.preventDefault(),J(!1)},children:h.jsxs("div",{className:"animate-modal-in w-96 rounded-xl border border-frame-line glass-panel p-4",children:[h.jsx("h3",{id:"args-modal-title",className:"mb-2 text-sm font-semibold text-ink",children:"Launch with Arguments"}),h.jsx("p",{className:"mb-3 text-xs text-ink-muted truncate",children:V.filename}),h.jsx("input",{type:"text",autoFocus:!0,placeholder:"Arguments (e.g. --verbose --port 80)",value:ie,onChange:re=>U(re.target.value),onKeyDown:re=>{re.key==="Enter"&&ae(),re.key==="Escape"&&J(!1)},className:"mb-4 w-full rounded-md border border-line bg-elevated px-3 py-2 text-xs text-ink outline-none focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500","aria-label":"Command line arguments"}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx("button",{onClick:()=>J(!1),className:"rounded-md px-3 py-1.5 text-xs text-ink-muted hover:bg-elevated hover:text-ink focus:outline-none focus:ring-2 focus:ring-indigo-500","aria-label":"Cancel launch",children:"Cancel"}),h.jsx("button",{onClick:ae,className:"btn btn-primary px-3 py-1.5","aria-label":`Launch ${V.filename} with arguments`,children:"Launch"})]})]})})]})}var uk=Vy();const bl=8,bi=8,ok=400,Ox={top:"bottom",bottom:"top",left:"right",right:"left"},sk={top:"-bottom-1 left-1/2 -translate-x-1/2",bottom:"-top-1 left-1/2 -translate-x-1/2",left:"-right-1 top-1/2 -translate-y-1/2",right:"-left-1 top-1/2 -translate-y-1/2"},ck={top:"border-b border-r",bottom:"border-t border-l",left:"border-t border-r",right:"border-b border-l"},Rx=(n,r,a)=>{switch(n){case"top":return r.top-bi-a.h>=bl;case"bottom":return r.bottom+bi+a.h<=window.innerHeight-bl;case"left":return r.left-bi-a.w>=bl;default:return r.right+bi+a.w<=window.innerWidth-bl}},fk=(n,r,a)=>{if(n==="top"||n==="bottom"){const f=r.left+r.width/2-a.w/2,m=window.innerWidth-a.w-bl;return{x:Math.min(Math.max(f,bl),Math.max(bl,m))-f,y:0}}const u=r.top+r.height/2-a.h/2,s=window.innerHeight-a.h-bl;return{x:0,y:Math.min(Math.max(u,bl),Math.max(bl,s))-u}},He=({text:n,children:r,block:a=!0,placement:u="top",suppress:s=!1})=>{const d=_.useRef(null),f=_.useRef(null),m=_.useId(),p=_.useRef(null),[x,y]=_.useState(!1),[g,w]=_.useState(u),[v,S]=_.useState({x:0,y:0}),[C,L]=_.useState({left:-9999,top:-9999}),z=()=>{p.current!==null&&(window.clearTimeout(p.current),p.current=null)};_.useEffect(()=>{s&&(z(),y(!1))},[s]),_.useEffect(()=>()=>z(),[]);const $=_.useCallback(()=>{const U=d.current,R=f.current;if(!U||!R)return;const Q=U.getBoundingClientRect(),fe={w:R.offsetWidth,h:R.offsetHeight},B=Rx(u,Q,fe)?u:Rx(Ox[u],Q,fe)?Ox[u]:u,ne=fk(B,Q,fe);w(B),S(ne);const V=Q.left+Q.width/2,se=Q.top+Q.height/2;L(B==="top"?{left:V,top:Q.top-bi-fe.h}:B==="bottom"?{left:V,top:Q.bottom+bi}:B==="left"?{left:Q.left-bi-fe.w,top:se}:{left:Q.right+bi,top:se})},[u]);_.useEffect(()=>{if(!x)return;const U=()=>y(!1);return window.addEventListener("resize",U),window.addEventListener("scroll",U,!0),()=>{window.removeEventListener("resize",U),window.removeEventListener("scroll",U,!0)}},[x]);const I=U=>{if(s)return;z();const R=()=>{$(),y(!0)};U?R():p.current=window.setTimeout(R,ok)},J=()=>{z(),y(!1)};_.useEffect(()=>{if(!x)return;const U=R=>{R.key==="Escape"&&y(!1)};return document.addEventListener("keydown",U,!0),()=>document.removeEventListener("keydown",U,!0)},[x]),_.useEffect(()=>{if(!x)return;const U=()=>!!document.querySelector('[role="dialog"][aria-modal="true"], dialog[open]');if(U()){y(!1);return}const R=new MutationObserver(()=>{U()&&y(!1)});return R.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["role","aria-modal","open","class"]}),()=>R.disconnect()},[x]);const ie={onMouseEnter:()=>I(!1),onMouseLeave:J,onFocus:()=>I(!0),onBlur:J,"aria-describedby":m};return h.jsxs("div",{ref:d,className:`group relative ${a?"flex min-w-0 flex-1 items-center":"inline-flex shrink-0 items-center"}`,onMouseEnter:()=>I(!1),onMouseLeave:J,onFocus:()=>I(!0),onBlur:J,children:[_.cloneElement(r,ie),uk.createPortal(h.jsxs("span",{ref:f,id:m,role:"tooltip",className:`pointer-events-none invisible fixed z-[var(--z-tooltip)] w-max max-w-[calc(100vw-16px)] rounded-md border border-line bg-elevated px-2 py-1 text-left text-[11px] leading-relaxed text-ink shadow-lg ${x?"visible opacity-100":"opacity-0"}`,style:{left:C.left,top:C.top,transform:g==="top"||g==="bottom"?`translateX(calc(-50% + ${v.x}px))`:`translateY(calc(-50% + ${v.y}px))`},children:[n,h.jsx("span",{className:`absolute h-2 w-2 rotate-45 border-line bg-elevated ${sk[g]} ${ck[g]}`,style:g==="top"||g==="bottom"?{left:`calc(50% - ${v.x}px)`}:void 0})]}),document.body)]})};function dk({isOpen:n,initialPath:r,onClose:a,onSelect:u}){const[s,d]=_.useState(null),[f,m]=_.useState(null),[p,x]=_.useState(""),[y,g]=_.useState(!1),[w,v]=_.useState(null),S=_.useRef(null),C=_.useRef(null),L=_.useRef(null);_.useEffect(()=>{var ie;if(!n){(ie=L.current)==null||ie.focus();return}L.current=document.activeElement instanceof HTMLElement?document.activeElement:null,v(null),z(r||"");const J=requestAnimationFrame(()=>{var U;return(U=C.current)==null?void 0:U.focus()});return()=>{var U;cancelAnimationFrame(J),(U=L.current)==null||U.focus()}},[n]);const z=async J=>{g(!0),v(null);try{const ie=await fetch(`/api/fs/browse?path=${encodeURIComponent(J)}`);if(!ie.ok)throw new Error("Failed to browse directory");const U=await ie.json();d(U),m(U.current_path),x(U.current_path)}catch(ie){v(ie.message||"Navigation failed")}finally{g(!1)}},$=()=>{const J=p.trim()||f;J&&(u(J),a())},I=J=>{var Q;if(J.key==="Escape"){J.preventDefault(),a();return}if(J.key!=="Tab")return;const ie=(Q=S.current)==null?void 0:Q.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(!(ie!=null&&ie.length))return;const U=ie[0],R=ie[ie.length-1];J.shiftKey&&document.activeElement===U?(J.preventDefault(),R.focus()):!J.shiftKey&&document.activeElement===R&&(J.preventDefault(),U.focus())};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/65 p-3 backdrop-blur-sm sm:p-6",onClick:a,children:h.jsxs("div",{ref:S,role:"dialog","aria-modal":"true","aria-labelledby":"directory-picker-title",onKeyDown:I,className:"animate-modal-in flex h-[min(84dvh,760px)] max-h-[calc(100dvh-1.5rem)] w-[min(94vw,960px)] min-h-0 flex-col overflow-hidden rounded-xl border border-frame-line glass-panel sm:rounded-2xl",onClick:J=>J.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-line px-4 py-3 sm:px-5",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Ji,{className:"h-5 w-5 text-chip-indigo-text"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{id:"directory-picker-title",className:"text-sm font-semibold text-ink",children:"Select a directory"}),h.jsx("p",{className:"truncate font-mono text-xs text-ink-muted",children:(s==null?void 0:s.current_path)||""})]})]}),h.jsx(He,{text:"Close",block:!1,children:h.jsx("button",{type:"button",onClick:a,"aria-label":"Close directory picker",className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg text-ink-muted transition-colors hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(nl,{className:"h-4 w-4"})})})]}),h.jsxs("div",{className:"border-b border-line px-4 py-3 sm:px-5",children:[h.jsx("label",{htmlFor:"directory-picker-path",className:"mb-1.5 block text-xs font-medium text-ink-secondary",children:"Location"}),h.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[h.jsx("input",{ref:C,id:"directory-picker-path",type:"text",value:p,onChange:J=>x(J.target.value),onKeyDown:J=>{J.key==="Enter"&&z(p.trim())},placeholder:"/path/to/directory",className:"h-10 min-w-0 flex-1 rounded-lg border border-line bg-elevated px-2.5 font-mono text-sm text-ink outline-none placeholder:text-ink-faint transition-colors hover:bg-surface-strong focus-visible:border-indigo-500 focus-visible:ring-2 focus-visible:ring-indigo-500/30"}),h.jsx("button",{type:"button",onClick:()=>z(p.trim()),className:"inline-flex h-10 shrink-0 items-center gap-1.5 rounded-lg border border-line bg-elevated px-3.5 text-sm font-medium text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Go"}),h.jsx(He,{text:"Home directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>z(""),"aria-label":"Home directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Yd,{className:"h-4 w-4"})})}),(s==null?void 0:s.parent_path)&&h.jsx(He,{text:"Parent directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>z(s.parent_path),"aria-label":"Parent directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Vd,{className:"h-4 w-4 rotate-180"})})})]})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 py-2 sm:px-3 sm:py-3","aria-busy":y,children:y?h.jsxs("div",{className:"flex h-full items-center justify-center gap-2.5 text-sm text-ink-muted",children:[h.jsx(Wi,{className:"h-5 w-5 animate-spin text-chip-indigo-text"}),h.jsx("span",{role:"status",children:"Loading directories…"})]}):w?h.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-2.5 text-center",children:[h.jsx("p",{className:"text-sm text-status-danger-text",children:w}),h.jsx("button",{type:"button",onClick:()=>z(p||(s==null?void 0:s.current_path)||""),className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Retry"})]}):h.jsxs("ul",{className:"space-y-0.5",children:[s==null?void 0:s.items.filter(J=>J.is_dir).map(J=>h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>z(J.path),onDoubleClick:()=>{x(J.path),u(J.path),a()},className:`flex min-h-10 w-full items-center justify-between rounded-lg px-3 py-1.5 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-400 ${f===J.path?"bg-chip-indigo-bg text-chip-indigo-text":"text-ink-secondary hover:bg-elevated hover:text-ink"}`,children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx(ss,{className:"h-5 w-5 shrink-0 text-chip-indigo-text"}),h.jsx("span",{className:"truncate",children:J.name})]}),f===J.path&&h.jsx(vi,{className:"h-4 w-4 shrink-0 text-chip-indigo-text"})]})},J.path)),(s==null?void 0:s.items.filter(J=>J.is_dir).length)===0&&h.jsxs("li",{className:"flex h-full min-h-36 flex-col items-center justify-center gap-2.5 text-center text-sm text-ink-muted",children:[h.jsx(Ji,{className:"h-7 w-7 text-ink-faint"}),"No subdirectories found"]})]})}),h.jsxs("div",{className:"flex flex-col gap-2 border-t border-line px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"mb-0.5 text-xs font-medium text-ink-muted",children:"Selected folder"}),h.jsx("p",{className:"truncate font-mono text-sm text-ink",title:f||p,children:f||p||"—"})]}),h.jsxs("div",{className:"flex shrink-0 justify-end gap-1.5",children:[h.jsx("button",{type:"button",onClick:a,className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Cancel"}),h.jsxs("button",{type:"button",onClick:$,disabled:!p.trim(),className:"btn btn-primary min-h-10 rounded-lg px-4 text-sm font-semibold",children:[h.jsx(Ji,{className:"h-4 w-4"}),"Select folder"]})]})]})]})}):null}function hk({visible:n,onFileSelected:r}){const a=_.useRef(null);return n?h.jsxs("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-drop-overlay)] flex items-center justify-center bg-black/65 backdrop-blur-sm",onClick:()=>{var u;return(u=a.current)==null?void 0:u.click()},"data-testid":"drop-config-overlay",children:[h.jsx("input",{ref:a,type:"file",accept:".profiles,.profiles.yaml,.profiles.yml,.yaml,.yml",className:"hidden",onChange:u=>{var d;const s=(d=u.target.files)==null?void 0:d[0];s&&r(s),u.target.value=""}}),h.jsxs("div",{className:"rounded-xl border-2 border-dashed border-chip-indigo-border bg-surface px-8 py-6 text-center shadow-2xl",children:[h.jsx("span",{className:"mx-auto mb-3 grid h-9 w-9 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Kr,{className:"h-5 w-5 text-chip-indigo-text"})}),h.jsx("p",{className:"text-sm font-semibold text-ink",children:"Drop configuration file"}),h.jsx("p",{className:"mt-1 text-xs text-ink-muted",children:".profiles, .profiles.yaml, .yml, .yaml — session-only preview"})]})]}):null}function mk({items:n,columnTemplate:r,resizePointerRef:a,resizeMovedRef:u}){return h.jsx("div",{className:"grid select-none items-center border-b border-l-2 border-l-transparent border-line/40 bg-surface/60 font-medium text-ink-muted shadow-sm backdrop-blur-md",role:"row","aria-rowindex":1,"data-file-list-header":!0,style:{gridTemplateColumns:r},children:n.map((s,d)=>{const f=!!(s.onSort&&s.sortKey),m=s.active?s.direction==="asc"?"ascending":"descending":"none";return h.jsxs("div",{role:"columnheader","data-column-key":s.sortKey,className:`group relative flex items-center gap-1.5 truncate px-3 py-2 ${f?"cursor-pointer hover:text-ink transition-colors":""} ${s.active?"text-ink":""}`,...f?{"aria-sort":m,tabIndex:0,onClick:s.onSort,onKeyDown:p=>{var x;(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),(x=s.onSort)==null||x.call(s))}}:{},children:[s.icon,h.jsx("span",{className:"truncate",children:s.label}),f?s.active?s.direction==="asc"?h.jsx(H2,{className:"ml-auto h-3 w-3 shrink-0 text-chip-indigo-text"}):h.jsx(Qy,{className:"ml-auto h-3 w-3 shrink-0 text-chip-indigo-text"}):h.jsx(Dx,{className:"ml-auto h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-40 hover:opacity-40"}):d>0&&h.jsx(Dx,{className:"ml-auto h-3 w-3 shrink-0 opacity-40"}),s.canResize&&s.onResizeBy&&h.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize ${s.label} column`,"aria-valuemin":$r,"aria-valuemax":ls,"aria-valuenow":s.width??s.defaultWidth??es,"aria-valuetext":`${s.width??s.defaultWidth??es} pixels wide`,title:"Drag to resize; use arrow keys or click either side to adjust",tabIndex:0,onClick:p=>{var g;p.preventDefault(),p.stopPropagation();const x=u.current;if(u.current=!1,x)return;const y=p.currentTarget.getBoundingClientRect();(g=s.onResizeBy)==null||g.call(s,p.clientX{p.preventDefault(),p.stopPropagation();const x=p.currentTarget.parentElement;u.current=!1,a.current={pointerId:p.pointerId,startX:p.clientX,startWidth:s.width??(x==null?void 0:x.getBoundingClientRect().width)??s.defaultWidth??es,resizeTo:s.onResizeTo},p.currentTarget.setPointerCapture(p.pointerId)},onPointerMove:p=>{const x=a.current;if(!x||x.pointerId!==p.pointerId)return;const y=p.clientX-x.startX;Math.abs(y)>2&&(u.current=!0),x.resizeTo(x.startWidth+y)},onPointerUp:p=>{var x;((x=a.current)==null?void 0:x.pointerId)===p.pointerId&&(p.currentTarget.releasePointerCapture(p.pointerId),a.current=null,window.setTimeout(()=>{u.current=!1},0))},onPointerCancel:()=>{a.current=null,u.current=!1},onKeyDown:p=>{var x,y;p.stopPropagation(),p.key==="ArrowLeft"||p.key==="ArrowRight"?(p.preventDefault(),(x=s.onResizeBy)==null||x.call(s,p.key==="ArrowLeft"?-Go:Go)):(p.key==="Home"||p.key==="End")&&(p.preventDefault(),(y=s.onResizeTo)==null||y.call(s,p.key==="Home"?$r:ls))},className:"absolute inset-y-0 right-0 z-10 w-3 cursor-col-resize touch-none border-r border-transparent transition-colors hover:border-indigo-400 focus-visible:border-indigo-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500"})]},d)})})}const Wn=28,Yo=12,ed=500,$r=80,ls=960,es=160,Go=24,Lx=44,Qo={File:2,Path:3,FileName:1,Type:1,Version:1};function pk({files:n,totalCount:r,rawLoadedCount:a,onLoadMore:u,loadingMore:s=!1,scanning:d=!1,hasScanned:f=!1,activeDirectory:m="",recursive:p=!1,onDisableRecursive:x,onOpenDirectory:y,onOpenConfig:g,filterText:w,onClearFilter:v,prefilterNote:S,columnHeaders:C,columnNames:L,selectedIndex:z,onSelectIndex:$,onLaunch:I,onContextMenu:J,rowColors:ie,sort:U,onSortChange:R}){const Q=["File"],fe=L.length>0?L:Q,B=C.length>0?C:fe,ne=Array.from({length:Math.max(fe.length,B.length)},(ge,Me)=>({key:fe[Me]??Q[0],header:B[Me]??fe[Me]??Q[0]})),V=_.useRef(null),[se,ve]=_.useState(0),[ae,A]=_.useState(600),[W,le]=_.useState(0),[re,N]=_.useState({}),qe=_.useRef(null),Ge=_.useRef(!1),M=fe.reduce((ge,Me)=>ge+(Qo[Me]??1),1),E=(ge,Me)=>{const Le=Math.min(ls,Math.max($r,Math.round(Me)));N(lt=>({...lt,[ge]:Le}))},Y=(ge,Me)=>{var K;const Le=Array.from(((K=V.current)==null?void 0:K.querySelectorAll("[data-column-key]"))??[]).find(ue=>ue.dataset.columnKey===ge),lt=re[ge]??(Le==null?void 0:Le.getBoundingClientRect().width)??es;E(ge,lt+Me)},oe=[`${Lx}px`,...fe.map(ge=>re[ge]?`${re[ge]}px`:`minmax(${$r}px, ${Qo[ge]??1}fr)`)].join(" "),de=_.useRef(!1),je=_.useRef(null),ye=n.length,_e=a??ye,pe=r??_e,Se=_e{const ge=V.current;if(!ge)return;const Me=new ResizeObserver(Le=>{for(const lt of Le)A(lt.contentRect.height),le(lt.contentRect.width)});return Me.observe(ge),A(ge.clientHeight||600),le(ge.clientWidth||0),()=>Me.disconnect()},[]),_.useEffect(()=>{var ue;const ge=V.current;if(!ge||z<0||z>=ye)return;const Me=((ue=ge.querySelector("[data-file-list-header]"))==null?void 0:ue.offsetHeight)??0,Le=Me+z*Wn,lt=Le+Wn;let K=ge.scrollTop;Lege.scrollTop+ge.clientHeight&&(K=lt-ge.clientHeight),K!==ge.scrollTop&&(ge.scrollTop=K,ve(K))},[z,ye]),_.useEffect(()=>{const ge=V.current;if(!ge)return;const Me=()=>{if(de.current||!Bt||!u)return;const Le=ge.scrollTop+ge.clientHeight,lt=ye*Wn;lt-LeLe&&(de.current=!0,window.setTimeout(()=>{de.current=!1},200),u())};return ge.addEventListener("scroll",Me,{passive:!0}),window.addEventListener("scroll",Me,{passive:!0}),()=>{ge.removeEventListener("scroll",Me),window.removeEventListener("scroll",Me)}},[n,Bt,u,ye]),_.useEffect(()=>{if(de.current||!Bt||!u)return;const ge=ye*Wn,Me=se+ae;if(!(ge-MeMe))return;const lt=`${ye}:${_e}:${pe}`;je.current=lt,u()});const Gt=_.useCallback(ge=>{ve(ge.currentTarget.scrollTop)},[]),St=Math.max(0,Math.floor(se/Wn)-Yo),nt=Math.ceil(ae/Wn)+Yo*2,Je=Math.min(ye,St+nt),en=St*Wn,bn=(ge,Me)=>{if(Me)return{className:"bg-chip-indigo-bg border-l-4 border-chip-indigo-border text-ink",style:{}};for(const[Le,lt]of ie)if(ge.toLowerCase().includes(Le.toLowerCase()))return{className:"hover:bg-elevated border-l-4 text-ink",style:{borderLeftColor:lt,borderLeftWidth:"4px"}};return{className:"border-l-4 border-transparent text-ink-secondary hover:bg-elevated/60",style:{borderLeftColor:"transparent",borderLeftWidth:"4px"}}},tn=(Bt?ye+nt:ye)*Wn,Ht="btn btn-secondary px-3 py-1.5";return h.jsxs("div",{ref:V,onScroll:Gt,className:"flex-1 overflow-auto bg-app text-xs transition-colors duration-200 focus-visible:outline focus-visible:outline-2 focus-visible:outline-indigo-500 focus-visible:outline-offset-[-2px]","data-testid":"file-list","data-loaded-count":_e,"aria-busy":d,role:"grid","aria-label":"Discovered files","aria-rowcount":Math.max(pe,ye===0?1:0)+1,"aria-colcount":fe.length+1,"aria-activedescendant":ye>0?`file-row-${z}`:void 0,tabIndex:0,children:[h.jsx("div",{className:"sticky top-0 z-10",role:"presentation",children:h.jsx(mk,{columnTemplate:oe,resizePointerRef:qe,resizeMovedRef:Ge,items:[{label:"#",icon:h.jsx(wd,{className:"h-3.5 w-3.5"})},...ne.map(({key:ge,header:Me})=>({label:Me,weight:Qo[ge]??1,width:re[ge],defaultWidth:Math.min(ls,Math.max($r,Math.round((W-Lx)*(Qo[ge]??1)/M))),canResize:!0,onResizeBy:Le=>Y(ge,Le),onResizeTo:Le=>E(ge,Le),sortKey:ge,active:(U==null?void 0:U.column)===ge,direction:U==null?void 0:U.direction,onSort:()=>{(U==null?void 0:U.column)!==ge?R({column:ge,direction:"asc"}):U.direction==="asc"?R({column:ge,direction:"desc"}):R(null)}}))]})}),S&&ye>0&&h.jsxs("div",{role:"note","data-testid":"prefilter-note",className:"flex items-center gap-1.5 border-b border-line/40 bg-surface px-3 py-1 text-[11px] text-ink-faint",children:[h.jsx(Ky,{className:"h-3 w-3 shrink-0 text-ink-faint","aria-hidden":"true"}),h.jsx("span",{className:"min-w-0 truncate",children:S})]}),ye===0?h.jsx("div",{role:"row","aria-rowindex":2,"data-testid":"file-list-empty",children:h.jsx("div",{role:"gridcell","aria-colspan":fe.length+1,className:"p-8 text-center text-ink-faint",children:d?h.jsxs("div",{className:"flex flex-col items-center gap-2",children:[h.jsx(Wi,{className:"h-5 w-5 animate-spin text-chip-indigo-text motion-reduce:animate-none"}),h.jsx("span",{children:"Scanning files..."})]}):!m.trim()&&g?h.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h.jsx("span",{children:"Select a directory first."}),h.jsx("button",{type:"button",onClick:g,className:Ht,children:"Choose configuration"})]}):f?w.trim()?h.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h.jsxs("span",{children:["No files match “",w,"”."]}),h.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[h.jsx("button",{type:"button",onClick:v,className:Ht,children:"Clear filter"}),p&&x&&h.jsx("button",{type:"button",onClick:x,className:Ht,children:"Turn off recursive"}),y&&h.jsx("button",{type:"button",onClick:y,className:Ht,children:"Open directory"})]})]}):h.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h.jsx("span",{children:"No files found for the current directory and extension."}),h.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[p&&x&&h.jsx("button",{type:"button",onClick:x,className:Ht,children:"Turn off recursive"}),y&&h.jsx("button",{type:"button",onClick:y,className:Ht,children:"Open directory"})]})]}):h.jsx("span",{children:"Select a directory and scan to find files."})})}):h.jsxs("div",{className:"relative",style:{height:tn},role:"rowgroup",children:[s&&h.jsx("div",{className:"pointer-events-none absolute left-1/2 top-2 z-20 -translate-x-1/2","aria-hidden":"true",children:h.jsx(Wi,{className:"h-4 w-4 animate-spin text-chip-indigo-text"})}),h.jsx("div",{style:{transform:`translateY(${en}px)`},"data-testid":"file-list-window",role:"presentation",children:n.slice(St,Je).map((ge,Me)=>{const Le=St+Me,lt=Le===z,K=bn(ge.filename,lt);return h.jsxs("div",{id:`file-row-${Le}`,"data-row-index":Le,role:"row","aria-rowindex":Le+2,"aria-selected":lt,onClick:()=>{var ue;$(Le),(ue=V.current)==null||ue.focus()},onDoubleClick:()=>I(ge),onContextMenu:ue=>J(ue,ge,Le),className:`grid cursor-pointer items-center transition-colors ${K.className}`,style:{...K.style,height:Wn,gridTemplateColumns:oe},children:[h.jsxs("div",{className:"flex items-center justify-end gap-1 px-3 font-mono text-ink-faint",children:[ge.has_hook&&h.jsx("span",{title:ge.hook_pattern?`Launch workflow: ${ge.hook_pattern}`:"Launch workflow configured","aria-label":"Workflow hook attached",className:"inline-flex items-center text-status-warning-text hover:brightness-95",children:h.jsx(eb,{className:"h-3 w-3 shrink-0"})}),h.jsx("span",{className:"hidden sm:inline",children:Le+1})]}),fe.map((ue,ke)=>{const Ce=ge.column_values[ue]||(ue==="File"?ge.filename:"-");return h.jsx("div",{role:"gridcell","data-column-key":ue,className:"truncate px-3 font-mono",style:{minWidth:$r},title:ue==="Path"?ge.path:Ce,children:Ce},ke)})]},ge.path||Le)})}),Se&&h.jsxs("div",{className:"pointer-events-none absolute bottom-2 left-1/2 -translate-x-1/2 rounded-full border border-line bg-surface-strong px-3 py-1 text-[11px] text-ink-muted shadow","data-testid":"file-list-paging",children:[s?h.jsx(O2,{className:"mr-1.5 h-4 w-4 animate-spin motion-reduce:animate-none text-ink-muted"}):null,"(",_e," of ",pe," loaded)"]})]})]})}function Sd({id:n,ariaLabel:r,value:a,options:u,onChange:s,placeholder:d,className:f="",inputClassName:m="",optionLabel:p=y=>y,onOpenChange:x}){const y=_.useId(),g=_.useRef(null),[w,v]=_.useState(!1),[S,C]=_.useState(""),[L,z]=_.useState(-1),$=u.filter(R=>p(R).toLocaleLowerCase().includes(S.toLocaleLowerCase())),I=L>=0&&$[L]?`${y}-option-${L}`:void 0;_.useEffect(()=>{const R=Q=>{var fe;(fe=g.current)!=null&&fe.contains(Q.target)||v(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]),_.useEffect(()=>{x==null||x(w)},[w,x]),_.useEffect(()=>{var R;L<0||(R=document.getElementById(`${y}-option-${L}`))==null||R.scrollIntoView({block:"nearest"})},[L,y]);const J=()=>{C(""),z(-1),v(!0)},ie=R=>{s(R),C(""),z(-1),v(!1)},U=R=>{if(R.key==="ArrowDown"){if(R.preventDefault(),!w){J(),z(0);return}z(Q=>Math.min(Q+1,$.length-1))}else if(R.key==="ArrowUp"){if(R.preventDefault(),!w){J(),z($.length-1);return}z(Q=>Q<=0?$.length-1:Q-1)}else R.key==="Enter"&&w&&$[L]!==void 0?(R.preventDefault(),ie($[L])):R.key==="Escape"&&v(!1)};return h.jsxs("div",{ref:g,onBlur:R=>{var Q;(Q=g.current)!=null&&Q.contains(R.relatedTarget)||v(!1)},className:`relative flex min-w-0 ${f}`,children:[h.jsx("input",{id:n,type:"text",role:"combobox","aria-label":r,"aria-autocomplete":"list","aria-expanded":w,"aria-controls":y,"aria-activedescendant":I,value:a,placeholder:d,onChange:R=>{s(R.target.value),C(R.target.value),z(-1),v(!0)},onKeyDown:U,className:`min-w-0 flex-1 rounded-l-md border border-line bg-elevated px-3 py-1.5 text-ink outline-none transition-colors hover:bg-surface-strong focus:border-indigo-500 ${m}`}),h.jsx("button",{type:"button","aria-label":`Show ${r.toLowerCase()} options`,"aria-expanded":w,title:`Show ${r.toLowerCase()} options`,onMouseDown:R=>R.preventDefault(),onClick:()=>w?v(!1):J(),className:"shrink-0 rounded-r-md border border-l-0 border-line bg-elevated px-2 text-ink-muted hover:bg-surface-strong hover:text-ink focus-visible:z-10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-indigo-500 transition-colors",children:h.jsx(I2,{className:`h-3.5 w-3.5 transition-transform ${w?"rotate-180":""}`})}),w&&h.jsx("ul",{id:y,role:"listbox","aria-label":`${r} options`,className:"absolute left-0 top-full z-[var(--z-combobox-list)] mt-1 max-h-60 w-full min-w-48 overflow-y-auto rounded-md border border-line bg-surface py-1 text-ink shadow-xl",children:$.length>0?$.map((R,Q)=>{const fe=p(R),B=Q===L,ne=R===a;return h.jsx("li",{id:`${y}-option-${Q}`,role:"option","aria-selected":ne,title:fe||void 0,onMouseEnter:()=>z(Q),onMouseDown:V=>V.preventDefault(),onClick:()=>ie(R),className:`cursor-pointer truncate px-3 py-1.5 ${B?"bg-elevated text-ink":"text-ink-secondary"} ${ne?"font-semibold":""}`,children:fe||"(No filter)"},`${R}-${Q}`)}):h.jsx("li",{className:"px-3 py-1.5 text-ink-muted",children:"No matching presets"})})]})}function gk({title:n,release:r,directories:a,activeDirectory:u,onDirectoryChange:s,onBrowseDirectory:d,onGoToParentDirectory:f,onGoToHomeDirectory:m,onOpenActiveDirectory:p,onOpenTerminal:x}){const[y,g]=_.useState(!1);return h.jsxs("header",{className:"relative z-30 flex flex-wrap items-center gap-3 border-b border-line bg-app/90 px-5 py-2 text-xs backdrop-blur-xl shadow-xs transition-all duration-200",children:[h.jsx("div",{className:"flex shrink-0 items-center gap-3",children:h.jsxs("div",{className:"flex items-center gap-3.5",children:[h.jsxs("div",{className:"relative flex h-9 w-9 items-center justify-center rounded-xl bg-gradient-to-br from-chip-indigo-bg to-chip-purple-bg text-chip-indigo-text border border-chip-indigo-border shadow-xs",children:[h.jsx(kd,{className:"h-4 w-4"}),h.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 flex h-2.5 w-2.5 items-center justify-center rounded-full bg-emerald-500 ring-2 ring-app"})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h1",{className:"text-sm font-bold tracking-tight text-ink font-heading",children:"ProFiles"}),n&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-ink-faint",children:"/"}),h.jsx("span",{className:"text-xs font-medium text-chip-indigo-text bg-chip-indigo-bg px-2 py-0.5 rounded-md border border-chip-indigo-border/50",children:n})]})]}),h.jsxs("p",{className:"text-[11px] font-medium text-ink-muted tracking-wide mt-0.5",children:["Crafted by ",h.jsx("span",{className:"text-ink font-semibold",children:"Florent ALBANY"})," • ",h.jsxs("span",{className:"font-mono text-chip-indigo-text",children:["v",r||"0.11.0-rc.2"]})]})]})]})}),h.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[h.jsxs("label",{className:"flex shrink-0 items-center gap-1.5 font-medium text-ink-secondary text-xs",children:[h.jsx(ss,{className:"h-3.5 w-3.5 text-chip-indigo-text"}),h.jsx("span",{children:"Directory:"})]}),h.jsx(He,{text:"Select or type a directory path to scan files from.",suppress:y,children:h.jsx(Sd,{id:"directory-combobox",ariaLabel:"Directory",value:u,options:a,onChange:s,onOpenChange:g,placeholder:"/path/to/directory",className:"w-full",inputClassName:"font-mono"})}),p&&h.jsx(He,{text:"Open the active directory in the OS file manager",block:!1,children:h.jsx("button",{type:"button",onClick:p,"aria-label":"Open active directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(L2,{className:"h-3.5 w-3.5"})})}),f&&h.jsx(He,{text:"Go to parent directory",block:!1,children:h.jsx("button",{type:"button",onClick:f,"aria-label":"Go to parent directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Vd,{className:"h-3.5 w-3.5 rotate-180"})})}),d&&h.jsx(He,{text:"Browse for a folder on this system",block:!1,children:h.jsx("button",{type:"button",onClick:d,"aria-label":"Browse directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Ji,{className:"h-3.5 w-3.5"})})}),x&&h.jsx(He,{text:"Open the active directory in a terminal",block:!1,children:h.jsx("button",{type:"button",onClick:()=>x(u),"aria-label":"Open directory in terminal",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(kd,{className:"h-3.5 w-3.5"})})}),m&&h.jsx(He,{text:"Set directory to your home folder",block:!1,children:h.jsx("button",{type:"button",onClick:m,"aria-label":"Go to home directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Yd,{className:"h-3.5 w-3.5"})})})]})]})}function xk({message:n,onRetry:r,retrying:a=!1}){return h.jsx("div",{className:"flex flex-1 items-center justify-center p-8",role:"alert","data-testid":"init-error-panel",children:h.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-line bg-surface p-6 text-center shadow-xl",children:[h.jsx("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-full border border-status-danger-border bg-status-danger-bg",children:h.jsx(lu,{className:"h-5 w-5 text-status-danger-text/80"})}),h.jsx("h3",{className:"text-sm font-semibold text-ink",children:"Couldn't load the app"}),h.jsx("p",{className:"mt-1 break-words text-xs text-ink-secondary",children:n}),h.jsxs("button",{type:"button",onClick:r,disabled:a,className:"btn btn-primary mx-auto mt-4 px-3.5 py-1.5 font-semibold shadow-sm",children:[h.jsx(cs,{className:`h-3.5 w-3.5 ${a?"animate-spin motion-reduce:animate-none":""}`}),h.jsx("span",{children:a?"Retrying...":"Retry"})]})]})})}const Ux=/"([^"]*)"|(\S+)/g,Bx=/"([^"]*)"/g,yk="Unmatched quote";function bk(n){const r=[];let a;for(Ux.lastIndex=0;(a=Ux.exec(n))!==null;){const f=a[1]!==void 0?a[1]:a[2];f&&f.trim()&&r.push(f)}let u="",s=0;Bx.lastIndex=0;let d;for(;(d=Bx.exec(n))!==null;)u+=n.slice(s,d.index),s=d.index+d[0].length;return u+=n.slice(s),{terms:r,error:u.includes('"')?yk:null}}function tb(n){const r=n.trim();if(!r)return{error:null,groups:[]};const{terms:a,error:u}=bk(r);if(a.length===0)return{error:u,groups:[]};const s=[];let d={includes:[],excludes:[]};for(const f of a){if(f.toUpperCase()==="OR"){s.push(d),d={includes:[],excludes:[]};continue}f==="-"||f==="+"||(f.startsWith("-")&&f.length>1?d.excludes.push(f.slice(1)):f.startsWith("+")&&f.length>1?d.includes.push(f.slice(1)):d.includes.push(f))}return s.push(d),{error:u,groups:s}}const vk=256,Ki=new Map;function Hx(n){return n.toLowerCase()}function wk(n){const r=Ki.get(n);if(r)return Ki.delete(n),Ki.set(n,r),r;const{groups:a}=tb(n),u={groups:a.map(s=>({includes:s.includes.map(Hx),excludes:s.excludes.map(Hx)}))};if(Ki.size>=vk){const s=Ki.keys().next().value;s!==void 0&&Ki.delete(s)}return Ki.set(n,u),u}function kk(n,r){return r.includes.every(a=>n.includes(a))&&!r.excludes.some(a=>n.includes(a))}function Sk(n,r){const{groups:a}=wk(r);if(a.length===0)return!0;const u=n.toLowerCase();return a.some(s=>kk(u,s))}function Nk({query:n,visible:r}){if(!r)return null;const a=tb(n);return a.error?h.jsx("div",{"data-testid":"filter-syntax-helper",className:"pointer-events-none absolute left-0 right-0 top-full z-[var(--z-syntax-helper)] mt-1 rounded-md border border-status-danger-border bg-surface-strong px-3 py-2 text-[11px] leading-5 text-status-danger-text/90 shadow-xl",children:a.error}):a.groups.length===0?null:h.jsxs("div",{"data-testid":"filter-syntax-helper",className:"pointer-events-none absolute left-0 right-0 top-full z-[var(--z-syntax-helper)] mt-1 rounded-md border border-line bg-surface-strong px-3 py-2 text-[11px] leading-5 text-ink-secondary shadow-xl",children:[h.jsx("span",{className:"mr-1.5 align-[1px] text-[10px] uppercase tracking-wide text-ink-muted",children:"reads as"}),a.groups.map((u,s)=>h.jsxs("span",{"data-testid":"filter-syntax-group",children:[s>0&&h.jsx("span",{className:"mx-1 font-mono text-chip-indigo-text",children:"OR"}),u.includes.map((d,f)=>h.jsxs("span",{children:[f>0&&h.jsx("span",{className:"text-ink-muted",children:" · "}),h.jsx("span",{className:"font-mono text-chip-indigo-text",children:d})]},`i-${f}`)),u.includes.length>0&&u.excludes.length>0&&h.jsx("span",{className:"text-ink-muted",children:" · "}),u.excludes.map((d,f)=>h.jsxs("span",{children:[f>0&&h.jsx("span",{className:"text-ink-muted",children:" · "}),h.jsx("span",{className:"text-ink-muted",children:"✕ "}),h.jsx("span",{className:"font-mono text-status-danger-text/70 line-through",children:d})]},`x-${f}`))]},s))]})}const qx=h.jsxs("span",{className:"flex flex-col gap-1 whitespace-nowrap text-left",children:[h.jsx("span",{className:"font-semibold",children:"Supported operators"}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"a b"})," — AND (both terms)"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"a OR b"})," — either term"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"-a"})," — NOT (exclude)"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"+a"})," — force include"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:'"a b"'})," — exact phrase"]})]});function Ek({extensions:n,activeExtension:r,onExtensionChange:a,filterOptions:u,filterText:s,onFilterTextChange:d,recursive:f,onRecursiveChange:m,onScan:p,scanning:x,barcodeMode:y,onBarcodeToggle:g,onCameraBarcodeClick:w,autoRescanActive:v,onTimerClick:S}){const[C,L]=_.useState(!1),[z,$]=_.useState(!1),[I,J]=_.useState(!1);return h.jsxs("div",{className:"flex w-full flex-wrap items-center gap-3 border-b border-line bg-surface-glass p-3 text-xs",children:[h.jsx(He,{text:qx,suppress:z,children:h.jsxs("div",{className:"relative min-w-0 flex-1 basis-64",onFocusCapture:ie=>{ie.target.tagName==="INPUT"&&L(!0)},onBlurCapture:ie=>{ie.target.tagName==="INPUT"&&L(!1)},children:[h.jsx($y,{className:"pointer-events-none absolute left-3 top-1/2 z-10 h-4 w-4 -translate-y-1/2 text-ink-secondary"}),h.jsx(Sd,{id:"filter-combobox",ariaLabel:"File filter",value:s,options:u||[],onChange:d,onOpenChange:$,placeholder:"Filter files: keyword, a OR b, -tag, exact phrase...",className:"w-full",inputClassName:"pl-9 pr-3",optionLabel:ie=>ie||"(No filter)"}),h.jsx(Nk,{query:s,visible:C&&!z&&s.trim().length>0})]})}),h.jsx(He,{text:qx,block:!1,suppress:I,children:h.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[h.jsx("span",{className:"text-ink-muted",children:"Ext:"}),h.jsx(Sd,{id:"extension-combobox",ariaLabel:"Extension filter",value:r,options:n,onChange:a,onOpenChange:J,placeholder:".py OR .toml",className:"w-44",inputClassName:"font-mono px-2.5"})]})}),h.jsx(He,{text:"Include subdirectories when scanning",block:!1,children:h.jsxs("label",{className:"flex shrink-0 cursor-pointer select-none items-center gap-1.5 text-ink-secondary",children:[h.jsx("input",{type:"checkbox",checked:f,onChange:ie=>m(ie.target.checked),className:"rounded border-line text-chip-indigo-text focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-1 focus-visible:ring-offset-app"}),h.jsx("span",{children:"Recursive"})]})}),h.jsx(He,{text:"Run the scan with the current criteria (Enter)",block:!1,children:h.jsxs("button",{onClick:p,disabled:x,className:"btn btn-primary shrink-0 px-3.5 py-1.5 font-semibold shadow-sm",children:[x?h.jsx(cs,{className:"h-3.5 w-3.5 animate-spin motion-reduce:animate-none"}):h.jsx(er,{className:"h-3.5 w-3.5 fill-current"}),h.jsx("span",{children:x?"Scanning...":"Scan"})]})}),h.jsx(He,{text:v?"Auto-rescan is active. Click to configure.":"Configure periodic auto-rescan (hot-folder mode)",block:!1,children:h.jsx("button",{type:"button",onClick:S,"aria-label":"Configure timer / auto-rescan",className:`flex shrink-0 items-center justify-center rounded-md border p-1.5 text-ink-secondary hover:border-indigo-500 hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 transition-colors ${v?"border-chip-indigo-border bg-chip-indigo-bg text-chip-indigo-text":"border-line bg-elevated"}`,children:h.jsx(Jy,{className:`h-3.5 w-3.5 ${v?"animate-pulse":""}`})})}),h.jsx(He,{text:"Toggle barcode scanner mode (USB HID). When active, scan a barcode to auto-fill controls and trigger a scan.",block:!1,children:h.jsx("button",{type:"button",onClick:g,"aria-label":y?"Disable barcode mode":"Enable barcode mode",className:`flex shrink-0 items-center justify-center rounded-md border p-1.5 text-ink-secondary hover:border-indigo-500 hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 transition-colors ${y?"border-chip-indigo-border bg-chip-indigo-bg text-chip-indigo-text":"border-line bg-elevated"}`,children:h.jsx(Gd,{className:`h-3.5 w-3.5 ${y?"animate-pulse":""}`})})}),w&&h.jsx(He,{text:"Scan barcode or QR code using webcam / camera (Ctrl + Shift + B)",block:!1,children:h.jsx("button",{type:"button",onClick:w,"aria-label":"Scan barcode with camera",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Xy,{className:"h-3.5 w-3.5"})})})]})}const jk=2e3,Ck=500,Tk=[{value:null,label:"ALL"},{value:"DEBUG",label:"DEBUG"},{value:"INFO",label:"INFO"},{value:"WARNING",label:"WARNING"},{value:"ERROR",label:"ERROR"},{value:"CRITICAL",label:"CRITICAL"}],Fx={DEBUG:{icon:F2,className:"text-chip-sky-text"},INFO:{icon:Ky,className:"text-status-success-text"},WARNING:{icon:Wy,className:"text-status-warning-text"},ERROR:{icon:bd,className:"text-status-danger-text"},CRITICAL:{icon:bd,className:"text-status-danger-text"},UNKNOWN:{icon:Pr,className:"text-ink-faint"}};function _k({isOpen:n,onClose:r,onOpenExternally:a}){const[u,s]=_.useState([]),[d,f]=_.useState("profiles.log"),[m,p]=_.useState(0),[x,y]=_.useState(null),[g,w]=_.useState(""),[v,S]=_.useState(!1),[C,L]=_.useState(!0),[z,$]=_.useState(null),[I,J]=_.useState(!0),ie=_.useRef(null),U=_.useRef(null),R=_.useRef(null),Q=_.useRef(null),fe=_.useRef(C),B=_.useRef({level:x,search:g});fe.current=C,B.current={level:x,search:g};const ne=_.useCallback(async()=>{const{level:A,search:W}=B.current;S(!0);try{const le=await o2({limit:Ck,level:A,search:W});s(le.entries),f(le.path),p(le.size_bytes),$(null)}catch(le){$((le==null?void 0:le.message)||"Failed to read the log file")}finally{S(!1)}},[]);_.useEffect(()=>{n&&ne()},[n,ne]),_.useEffect(()=>{if(!n||!C)return;const A=window.setInterval(()=>{ne()},jk);return()=>window.clearInterval(A)},[n,C,ne]),_.useEffect(()=>{if(!n)return;const A=window.setTimeout(()=>void ne(),250);return()=>window.clearTimeout(A)},[n,x,g,ne]),_.useEffect(()=>{if(!I)return;const A=R.current;A&&(A.scrollTop=A.scrollHeight)},[u,I]),_.useEffect(()=>{if(!n)return;const A=document.activeElement instanceof HTMLElement?document.activeElement:null,W=requestAnimationFrame(()=>{var le;return(le=U.current)==null?void 0:le.focus()});return()=>{cancelAnimationFrame(W),A==null||A.focus()}},[n]);const V=A=>{var N;if(A.key==="Escape"){A.preventDefault(),r();return}if(A.key!=="Tab")return;const W=(N=ie.current)==null?void 0:N.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(!(W!=null&&W.length))return;const le=W[0],re=W[W.length-1];A.shiftKey&&document.activeElement===le?(A.preventDefault(),re.focus()):!A.shiftKey&&document.activeElement===re&&(A.preventDefault(),le.focus())},se=()=>{const A=R.current;if(!A)return;const W=A.scrollHeight-A.scrollTop-A.clientHeight<24;J(W)},ve=async()=>{try{await navigator.clipboard.writeText(u.map(A=>A.raw).join(` -`))}catch{}},ae=_.useMemo(()=>{const A=new Map;for(const W of u)A.set(W.level,(A.get(W.level)??0)+1);return A},[u]);return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/65 p-3 backdrop-blur-sm sm:p-6",onClick:r,children:h.jsxs("div",{ref:ie,role:"dialog","aria-modal":"true","aria-labelledby":"log-viewer-title",onKeyDown:V,className:"animate-modal-in flex h-[min(84dvh,760px)] w-[clamp(560px,85vw,1500px)] min-h-0 flex-col overflow-hidden rounded-xl border border-frame-line glass-panel sm:rounded-2xl",onClick:A=>A.stopPropagation(),children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-b border-line px-5 py-4 sm:px-6",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[h.jsx("span",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Pr,{className:"h-5 w-5 text-chip-indigo-text","aria-hidden":"true"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{id:"log-viewer-title",className:"text-base font-semibold text-ink",children:"Application logs"}),h.jsxs("p",{className:"truncate font-mono text-xs text-ink-muted",children:[d,h.jsxs("span",{className:"text-ink-faint",children:[" · ",Vx(m)]})]})]})]}),h.jsxs("div",{className:"relative min-w-[220px] flex-1",children:[h.jsx($y,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ink-faint","aria-hidden":"true"}),h.jsx("input",{ref:Q,type:"search",value:g,onChange:A=>w(A.target.value),placeholder:"Filter log lines…","aria-label":"Filter log lines",className:"w-full rounded-lg border border-line bg-elevated py-1.5 pl-8 pr-2.5 font-mono text-xs text-ink placeholder:text-ink-faint focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400"})]}),h.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[h.jsx(He,{text:C?"Pause live tail":"Resume live tail",block:!1,children:h.jsxs("button",{type:"button",onClick:()=>L(A=>!A),"aria-pressed":C,className:`flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400 ${C?"border-status-success-border bg-status-success-bg text-status-success-text":"border-line bg-elevated text-ink-muted hover:text-ink"}`,children:[h.jsx("span",{className:`h-2 w-2 rounded-full ${C?"bg-emerald-400":"bg-ink-faint"}`,"aria-hidden":"true"}),C?"Live":"Paused"]})}),h.jsx(He,{text:"Refresh now",block:!1,children:h.jsx("button",{type:"button",onClick:()=>void ne(),disabled:v,className:"rounded-lg border border-line bg-elevated p-2 text-ink-muted hover:text-ink disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(cs,{className:`h-4 w-4 ${v?"animate-spin":""}`,"aria-hidden":"true"})})}),h.jsx(He,{text:"Copy visible lines",block:!1,children:h.jsx("button",{type:"button",onClick:()=>void ve(),disabled:u.length===0,className:"rounded-lg border border-line bg-elevated p-2 text-ink-muted hover:text-ink disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(An,{className:"h-4 w-4","aria-hidden":"true"})})}),h.jsx(He,{text:"Open log file in the default application",block:!1,children:h.jsx("button",{type:"button",onClick:()=>{a==null||a(),r()},className:"rounded-lg border border-line bg-elevated p-2 text-ink-muted hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(uw,{className:"h-4 w-4","aria-hidden":"true"})})}),h.jsx(He,{text:"Close",block:!1,children:h.jsx("button",{ref:U,type:"button",onClick:r,className:"rounded-lg p-2 text-ink-muted hover:bg-hover-surface hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(nl,{className:"h-4 w-4","aria-hidden":"true"})})})]})]}),h.jsxs("div",{ref:R,onScroll:se,className:"min-h-0 flex-1 overflow-y-auto overscroll-contain bg-app px-2 py-2 font-mono text-xs leading-relaxed sm:px-3",children:[h.jsxs("div",{className:"sticky top-0 z-10 mb-1 flex items-center gap-2 rounded-md border border-line/40 bg-surface/60 px-2 py-1 text-[10px] font-bold uppercase tracking-wider text-ink-muted shadow-sm backdrop-blur-md",role:"row",children:[h.jsx("span",{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),h.jsx("span",{className:"w-[138px] shrink-0 text-ink/70",children:"Time"}),h.jsx("span",{className:"w-[52px] shrink-0 text-ink/70",children:"Level"}),h.jsx("span",{className:"w-[150px] shrink-0 text-ink/70",children:"Source"}),h.jsx("span",{className:"min-w-0 flex-1 text-ink/70",children:"Message"})]}),z&&h.jsx("p",{role:"alert",className:"px-3 py-6 text-center text-xs text-status-danger-text",children:z}),!z&&u.length===0&&!v&&h.jsx("p",{className:"px-3 py-6 text-center text-xs text-ink-faint",children:"No log entries match the current filters."}),h.jsx("ul",{className:"space-y-0.5",children:u.map((A,W)=>{const le=Fx[A.level]??Fx.UNKNOWN,re=le.icon,N=A.level==="ERROR"||A.level==="CRITICAL";return h.jsxs("li",{className:`group flex items-start gap-2 rounded px-2 py-1 ${N?"bg-status-danger-bg/40":"hover:bg-elevated/50"}`,children:[h.jsx("span",{className:le.className,children:h.jsx(re,{className:"mt-0.5 h-3.5 w-3.5","aria-hidden":"true"})}),h.jsx("span",{className:"w-[138px] shrink-0 text-ink-faint",children:A.timestamp}),h.jsx("span",{className:`w-[52px] shrink-0 text-[10px] font-semibold ${le.className}`,children:A.level}),h.jsx("span",{className:"w-[150px] shrink-0 truncate text-ink-faint",title:A.source,children:A.source}),h.jsx("span",{className:"min-w-0 flex-1 break-words text-ink-secondary",children:A.message})]},`${W}-${A.raw}`)})})]}),h.jsx("div",{className:"border-t border-line/60 bg-elevated/50 px-5 py-2.5 text-[11px] text-ink-faint shadow-sm backdrop-blur-md sm:px-6",children:h.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[h.jsx("span",{className:"mr-auto min-w-0 max-w-full basis-full truncate sm:basis-auto",role:"status","aria-atomic":"true",children:v&&u.length===0?"Loading log entries…":`${u.length} of ${Vx(m)} shown`}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"flex overflow-hidden rounded-lg border border-line/60 text-[11px] backdrop-blur-sm",role:"group","aria-label":"Filter by log level",children:Tk.map(A=>{const W=x===A.value,le=A.value?ae.get(A.value)??0:u.length;return h.jsxs("button",{type:"button",onClick:()=>y(A.value),"aria-pressed":W,title:A.value?`Show ${A.value} and above`:"Show all levels",className:`flex items-center gap-1 px-2.5 py-1 font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-400 ${W?"bg-indigo-600 text-white":"text-ink-muted hover:bg-elevated hover:text-ink"}`,children:[A.label,h.jsx("span",{className:W?"text-chip-indigo-text":"text-ink-faint",children:le})]},A.label)})}),h.jsx(He,{text:"Scroll to the newest entry",block:!1,children:h.jsxs("button",{type:"button",onClick:()=>J(!0),"aria-pressed":I,className:`flex items-center gap-1.5 rounded-lg border px-2.5 py-1 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400 ${I?"border-chip-indigo-border bg-chip-indigo-bg text-chip-indigo-text":"border-line bg-elevated text-ink-muted hover:text-ink"}`,children:[h.jsx(Qy,{className:"h-3.5 w-3.5","aria-hidden":"true"}),h.jsx("span",{className:"hidden sm:inline",children:"Follow tail"})]})})]}),h.jsxs("span",{className:"hidden items-center gap-1.5 lg:flex",children:[h.jsx("span",{className:"hidden sm:inline",children:"Ctrl + Shift + L"}),h.jsx("span",{children:"opens externally"})]})]})})]})}):null}function Vx(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}const Yx='button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], video[tabindex], [tabindex]:not([tabindex="-1"])';function Wr({isOpen:n,onClose:r,dialogRef:a,initialFocusRef:u}){return _.useEffect(()=>{if(!n)return;const s=document.activeElement instanceof HTMLElement?document.activeElement:null,d=requestAnimationFrame(()=>{var p;const m=(u==null?void 0:u.current)??((p=a.current)==null?void 0:p.querySelector(Yx))??a.current;m==null||m.focus()}),f=m=>{if(m.key!=="Tab")return;const p=a.current;if(!p)return;const x=Array.from(p.querySelectorAll(Yx));if(!x.length)return;const y=x[0],g=x[x.length-1],w=document.activeElement;if(!(w instanceof Node&&p.contains(w))){m.preventDefault(),(m.shiftKey?g:y).focus();return}m.shiftKey&&(w===y||w===p)?(m.preventDefault(),g.focus()):!m.shiftKey&&(w===g||w===p)&&(m.preventDefault(),y.focus())};return window.addEventListener("keydown",f,!0),()=>{cancelAnimationFrame(d),s==null||s.focus(),window.removeEventListener("keydown",f,!0)}},[n]),s=>{s.key==="Escape"&&(s.preventDefault(),s.stopPropagation(),r())}}function Ak({isOpen:n,onClose:r}){const a=_.useRef(null),u=Wr({isOpen:n,onClose:r,dialogRef:a});if(!n)return null;const s=[{key:"F5",desc:"Refresh / re-scan file list"},{key:"Ctrl + R",desc:"Reload configuration & scan"},{key:"Enter",desc:"Execute / launch selected file"},{key:"P",desc:"Open properties for selected file"},{key:"↑ / ↓",desc:"Navigate file list"},{key:"Home / End",desc:"Jump to first / last file"},{key:"PageUp / PageDown",desc:"Page through the file list"},{key:"Ctrl + D",desc:"Focus Directory field"},{key:"Ctrl + E",desc:"Focus Extension field"},{key:"Ctrl + F",desc:"Focus Filter / Search field"},{key:"Ctrl + L",desc:"Focus File List"},{key:"Ctrl + Shift + L",desc:"Open the log viewer"},{key:"Ctrl + ,",desc:"Open config file"},{key:"Ctrl + Shift + T",desc:"Toggle theme (Dark / Light)"},{key:"Ctrl + B",desc:"Toggle barcode scanner mode"},{key:"Ctrl + Shift + B",desc:"Open webcam / camera barcode scanner"},{key:"Ctrl + T",desc:"Open auto-rescan timer modal"},{key:"Ctrl + H",desc:"Set directory to home folder"},{key:"? or Ctrl + /",desc:"Show keyboard shortcuts"},{key:"Y / S / N",desc:"Answer workflow guard: Yes / Skip / No (prompt open)"},{key:"Enter",desc:"Confirm active workflow prompt (prompt open)"},{key:"Escape",desc:"Close dialogs / context menu"}];return h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",children:h.jsxs("div",{ref:a,role:"dialog","aria-modal":"true","aria-label":"Keyboard Shortcuts",onKeyDown:u,className:"animate-modal-in w-[450px] max-w-full rounded-2xl border border-frame-line glass-panel p-5",children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink",children:[h.jsx(Zy,{className:"h-5 w-5 text-chip-indigo-text"}),h.jsx("span",{children:"Keyboard Shortcuts"})]}),h.jsx("button",{onClick:r,className:"focus-ring rounded-lg p-1 text-ink-muted hover:bg-elevated hover:text-ink",children:h.jsx(nl,{className:"h-4 w-4"})})]}),h.jsx("div",{className:"max-h-[60vh] space-y-2 overflow-y-auto pr-1 text-xs",children:s.map(({key:d,desc:f})=>h.jsxs("div",{className:"flex items-center justify-between rounded-lg bg-elevated/50 px-3 py-2",children:[h.jsx("span",{className:"text-ink-secondary",children:f}),h.jsx("kbd",{className:"rounded bg-app px-2 py-0.5 font-mono text-[11px] font-semibold text-chip-indigo-text border border-line",children:d})]},d))}),h.jsx("div",{className:"mt-5 flex justify-end",children:h.jsx("button",{onClick:r,className:"btn btn-primary rounded-lg px-4 py-2 font-semibold",children:"Close"})})]})})}function zk({isOpen:n,activeConfigPath:r,configExists:a=!0,onClose:u,onLoaded:s}){const[d,f]=_.useState(null),[m,p]=_.useState(""),[x,y]=_.useState(null),[g,w]=_.useState(!1),[v,S]=_.useState(null),C=_.useRef(null),L=_.useRef(null),z=_.useRef(null),$=a===!1;_.useEffect(()=>{var ne;if(!n){(ne=z.current)==null||ne.focus();return}z.current=document.activeElement instanceof HTMLElement?document.activeElement:null,S(null);const R=r??"",Q=Math.max(R.lastIndexOf("/"),R.lastIndexOf("\\")),fe=Q>0?R.slice(0,Q):"";I(fe);const B=requestAnimationFrame(()=>{var V;return(V=L.current)==null?void 0:V.focus()});return()=>{var V;cancelAnimationFrame(B),(V=z.current)==null||V.focus()}},[n,r]);const I=async R=>{w(!0),S(null);try{const Q=await m2(R);f(Q),p(Q.current_path),r&&Q.items.some(fe=>fe.path===r)?y(r):y(null)}catch(Q){S(Q.message||"Navigation failed")}finally{w(!1)}},J=R=>{var ne;if(R.key==="Escape"){R.preventDefault(),u();return}if(R.key!=="Tab")return;const Q=(ne=C.current)==null?void 0:ne.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(!(Q!=null&&Q.length))return;const fe=Q[0],B=Q[Q.length-1];R.shiftKey&&document.activeElement===fe?(R.preventDefault(),B.focus()):!R.shiftKey&&document.activeElement===B&&(R.preventDefault(),fe.focus())},ie=async()=>{var Q;const R=x||(((Q=d==null?void 0:d.items.find(fe=>fe.is_config))==null?void 0:Q.path)??null);if(!R){S("Select a configuration file to load.");return}try{w(!0);const fe=await c2(R);s(fe),u()}catch(fe){S(fe.message||"Unable to load configuration")}finally{w(!1)}},U=async()=>{const R=(m||(d==null?void 0:d.current_path)||"").trim();if(!R){S("Choose a directory before creating a configuration.");return}try{w(!0);const Q=await h2(R);s(Q),u()}catch(Q){S(Q.message||"Unable to create configuration")}finally{w(!1)}};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/65 p-3 backdrop-blur-sm sm:p-6",onClick:u,children:h.jsxs("div",{ref:C,role:"dialog","aria-modal":"true","aria-labelledby":"load-config-title",onKeyDown:J,className:"animate-modal-in flex h-[min(84dvh,760px)] max-h-[calc(100dvh-1.5rem)] w-[min(94vw,960px)] min-h-0 flex-col overflow-hidden rounded-xl border border-frame-line glass-panel sm:rounded-2xl",onClick:R=>R.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-line px-4 py-3 sm:px-5",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Kr,{className:"h-5 w-5 text-chip-indigo-text"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{id:"load-config-title",className:"text-sm font-semibold text-ink",children:$?"Create configuration":"Load configuration"}),h.jsx("p",{className:"truncate font-mono text-xs text-ink-muted",children:(d==null?void 0:d.current_path)||""})]})]}),h.jsx(He,{text:"Close",block:!1,children:h.jsx("button",{type:"button",onClick:u,"aria-label":"Close configuration modal",className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg text-ink-muted transition-colors hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(nl,{className:"h-4 w-4"})})})]}),$&&h.jsx("div",{className:"border-b border-line bg-chip-indigo-bg/20 px-4 py-3 text-xs text-ink-secondary",children:"No configuration file was found. Create one here?"}),h.jsxs("div",{className:"border-b border-line px-4 py-3 sm:px-5",children:[h.jsx("label",{htmlFor:"config-path-input",className:"mb-1.5 block text-xs font-medium text-ink-secondary",children:"Configuration directory"}),h.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[h.jsx("input",{ref:L,id:"config-path-input",type:"text",value:m,onChange:R=>p(R.target.value),onKeyDown:R=>{R.key==="Enter"&&I(m.trim())},placeholder:"/path/to/directory",className:"h-10 min-w-0 flex-1 rounded-lg border border-line bg-elevated px-2.5 font-mono text-sm text-ink outline-none placeholder:text-ink-faint transition-colors hover:bg-surface-strong focus-visible:border-indigo-500 focus-visible:ring-2 focus-visible:ring-indigo-500/30"}),h.jsx("button",{type:"button",onClick:()=>I(m.trim()),className:"inline-flex h-10 shrink-0 items-center gap-1.5 rounded-lg border border-line bg-elevated px-3.5 text-sm font-medium text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Go"}),h.jsx(He,{text:"Home directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>I(""),"aria-label":"Home directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Yd,{className:"h-4 w-4"})})}),(d==null?void 0:d.parent_path)&&h.jsx(He,{text:"Parent directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>I(d.parent_path),"aria-label":"Parent directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Vd,{className:"h-4 w-4 rotate-180"})})})]})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 py-2 sm:px-3 sm:py-3","aria-busy":g,children:g?h.jsxs("div",{className:"flex h-full items-center justify-center gap-2.5 text-sm text-ink-muted",children:[h.jsx(Wi,{className:"h-5 w-5 animate-spin text-chip-indigo-text"}),h.jsx("span",{role:"status",children:"Loading configuration files…"})]}):v?h.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-2.5 text-center",children:[h.jsx("p",{className:"text-sm text-status-danger-text",children:v}),h.jsx("button",{type:"button",onClick:()=>I(m||(d==null?void 0:d.current_path)||""),className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Retry"})]}):h.jsxs("ul",{className:"space-y-1",children:[d==null?void 0:d.items.map(R=>{if(R.is_dir)return h.jsx("li",{children:h.jsx("button",{onClick:()=>I(R.path),onDoubleClick:()=>I(R.path),className:"flex w-full items-center justify-between rounded-md px-3 py-1.5 text-left text-xs text-ink-secondary hover:bg-elevated",children:h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(ss,{className:"h-3.5 w-3.5 text-chip-indigo-text"}),R.name]})})},R.path);const Q=x===R.path;return h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>y(R.path),"aria-pressed":Q,className:`flex w-full items-center justify-between rounded-lg px-3 py-1.5 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-400 ${Q?"bg-chip-indigo-bg text-chip-indigo-text":"text-ink-secondary hover:bg-elevated hover:text-ink"}`,children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx(Pr,{className:"h-5 w-5 shrink-0 text-chip-amber-text"}),h.jsx("span",{className:"truncate",children:R.name})]}),R.is_config&&h.jsx(Kr,{className:"h-4 w-4 shrink-0 text-chip-indigo-text"}),Q&&h.jsx(vi,{className:"h-4 w-4 shrink-0 text-chip-indigo-text"})]})},R.path)}),(d==null?void 0:d.items.filter(R=>R.is_config).length)===0&&h.jsxs("li",{className:"flex h-full min-h-36 flex-col items-center justify-center gap-2.5 text-center text-sm text-ink-muted",children:[h.jsx(Pr,{className:"h-7 w-7 text-ink-faint"}),"No configuration files found"]})]})}),h.jsxs("div",{className:"flex flex-col gap-2 border-t border-line px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"mb-0.5 text-xs font-medium text-ink-muted",children:"Selected file"}),h.jsx("p",{className:"truncate font-mono text-sm text-ink",title:x||m,children:x||m||"—"})]}),h.jsxs("div",{className:"flex shrink-0 justify-end gap-1.5",children:[h.jsx("button",{type:"button",onClick:u,className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Cancel"}),$?h.jsxs("button",{type:"button",onClick:U,disabled:!m.trim(),className:"btn btn-primary min-h-10 rounded-lg px-4 text-sm font-semibold",children:[h.jsx(Kr,{className:"h-4 w-4"}),"Create configuration"]}):h.jsxs("button",{type:"button",onClick:ie,disabled:!x,className:"btn btn-primary min-h-10 rounded-lg px-4 text-sm font-semibold",children:[h.jsx(Kr,{className:"h-4 w-4"}),"Load configuration"]})]})]})]})}):null}function nb({isOpen:n,onClose:r,initialFilePath:a,md5:u}){const[s,d]=_.useState(null),[f,m]=_.useState(""),[p,x]=_.useState([]),[y,g]=_.useState(!1),[w,v]=_.useState(null),[S,C]=_.useState(!1),[L,z]=_.useState(!1),[$,I]=_.useState(null),J=_.useRef(null),ie=Wr({isOpen:n,onClose:r,dialogRef:J});_.useEffect(()=>{if(!n)return;async function ae(){if(a){g(!0);try{const A=await _x({filePath:a});d(A.image),m(A.content),U(A.content)}catch(A){v(A.message)}finally{g(!1)}}}ae()},[n,a]);const U=ae=>{const A=ae.split(";").map(W=>{const le=W.split("=");return{key:le[0]||"",value:le[1]||""}}).filter(W=>W.key||W.value);x(A)},R=async ae=>{const A=ae.filter(W=>W.key.trim()).map(W=>`${W.key.trim()}=${W.value.trim()}`).join(";");if(m(A),!A){d(null);return}try{const W=await _x({content:A});d(W.image)}catch(W){console.error("Failed to re-generate barcode:",W)}},Q=(ae,A,W)=>{const le=[...p];le[ae][A]=W,x(le),R(le)},fe=()=>{const ae=[...p,{key:"",value:""}];x(ae)},B=ae=>{const A=p.filter((W,le)=>le!==ae);x(A),R(A)},ne=()=>{if(!u||p.some(A=>A.key.toLowerCase()==="md5"))return;const ae=[...p,{key:"md5",value:u}];x(ae),R(ae)},V=async()=>{if(s){I("Saving…");try{const ae=await v2(s,`profiles-qr-${Date.now()}.png`);I(ae.path||ae.message)}catch(ae){I(`Save failed: ${(ae==null?void 0:ae.message)??ae}`)}finally{setTimeout(()=>I(null),6e3)}}},se=async()=>{try{await navigator.clipboard.writeText(f),C(!0),setTimeout(()=>C(!1),2e3)}catch(ae){console.error("Copy failed",ae)}},ve=async()=>{if(s)try{const A=await(await fetch(s)).blob();await navigator.clipboard.write([new ClipboardItem({[A.type]:A})]),z(!0),setTimeout(()=>z(!1),2e3)}catch(ae){console.error("Image copy failed",ae)}};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4",onClick:r,children:h.jsxs("div",{ref:J,role:"dialog","aria-modal":"true","aria-label":"QR Code Settings",onKeyDown:ie,className:"animate-modal-in w-full max-w-md rounded-xl border border-frame-line glass-panel p-6",onClick:ae=>ae.stopPropagation(),children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[h.jsx("h3",{className:"text-sm font-semibold text-ink",children:"QR Code Settings"}),h.jsx("button",{onClick:r,className:"focus-ring rounded-md p-1 text-ink-muted hover:bg-elevated hover:text-ink",children:h.jsx(nl,{className:"h-4 w-4"})})]}),y?h.jsx("div",{className:"flex h-48 items-center justify-center",children:h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-600 border-t-transparent"})}):w?h.jsx("div",{className:"rounded-md border border-status-danger-border bg-status-danger-bg p-4 text-center text-xs text-status-danger-text",children:w}):h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-col items-center gap-4",children:[h.jsxs("div",{className:"relative group",children:[h.jsx("div",{className:"h-48 w-48 overflow-hidden rounded-lg border border-line bg-white p-2",children:s?h.jsx("img",{src:s,alt:"QR Code",className:"h-full w-full object-contain"}):h.jsx("div",{className:"flex h-full items-center justify-center text-xs text-slate-400",children:"No content"})}),s&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-black/20 rounded-lg",children:h.jsxs("button",{onClick:ve,className:"focus-ring flex items-center gap-2 rounded-md bg-white/90 p-2 text-xs font-medium text-slate-900 shadow-sm hover:bg-white",children:[L?h.jsx(vi,{className:"h-3.5 w-3.5"}):h.jsx(An,{className:"h-3.5 w-3.5"}),L?"Copied":"Copy Image"]})})]}),h.jsxs("div",{className:"flex w-full gap-2",children:[h.jsxs("button",{onClick:se,className:"btn btn-secondary flex-1 px-3 py-1.5",children:[S?h.jsx(vi,{className:"h-3.5 w-3.5 text-status-success-text"}):h.jsx(An,{className:"h-3.5 w-3.5"}),"Copy Content"]}),h.jsxs("button",{onClick:V,disabled:!s,className:"btn btn-primary flex-1 px-3 py-1.5",children:[h.jsx(Iy,{className:"h-3.5 w-3.5"}),"Save Image"]})]}),$&&h.jsx("p",{className:"break-all text-center text-[11px] text-ink-muted",role:"status",children:$})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("label",{className:"text-xs font-medium text-ink-muted uppercase tracking-wider",children:"Payload Fields"}),h.jsxs("div",{className:"flex gap-2",children:[u&&!p.some(ae=>ae.key==="md5")&&h.jsxs("button",{onClick:ne,className:"btn-chip flex items-center gap-1 rounded px-2 py-0.5 text-[10px] font-bold text-chip-purple-text border border-chip-purple-border",children:[h.jsx(Zr,{className:"h-3 w-3"})," Inc. MD5"]}),h.jsxs("button",{onClick:fe,className:"btn-chip flex items-center gap-1 rounded px-2 py-0.5 text-[10px] font-bold text-chip-indigo-text border border-chip-indigo-border",children:[h.jsx(Lw,{className:"h-3 w-3"})," Add Field"]})]})]}),h.jsxs("div",{className:"max-h-48 space-y-2 overflow-y-auto pr-1 custom-scrollbar",children:[p.map((ae,A)=>h.jsxs("div",{className:"flex gap-2 items-center slide-in",children:[h.jsx("input",{type:"text",placeholder:"key",value:ae.key,onChange:W=>Q(A,"key",W.target.value),className:"w-1/3 rounded border border-line bg-elevated px-2 py-1 text-xs text-ink focus:border-indigo-500 focus:outline-none"}),h.jsx("input",{type:"text",placeholder:"value",value:ae.value,onChange:W=>Q(A,"value",W.target.value),className:"flex-1 rounded border border-line bg-elevated px-2 py-1 text-xs text-ink focus:border-indigo-500 focus:outline-none"}),h.jsx("button",{onClick:()=>B(A),className:"p-1 text-ink-muted hover:text-status-danger-text transition-colors","aria-label":"Remove field",children:h.jsx(Py,{className:"h-3.5 w-3.5"})})]},A)),p.length===0&&h.jsx("p",{className:"text-center py-4 text-xs text-ink-muted italic",children:"No fields defined"})]})]}),h.jsxs("div",{className:"pt-2 border-t border-line",children:[h.jsx("label",{className:"text-[10px] font-medium text-ink-muted uppercase tracking-wider block mb-1.5",children:"Raw Preview"}),h.jsx("div",{className:"rounded bg-elevated p-2 font-mono text-[10px] text-ink-secondary break-all border border-line",children:f||h.jsx("span",{className:"italic text-ink-muted/50",children:"empty"})})]})]})]})}):null}const Gx=["Bytes","KB","MB","GB","TB"];function lb(n){if(n===0)return"0 Bytes";const r=1024,a=Math.max(0,Math.min(Gx.length-1,Math.floor(Math.log(n)/Math.log(r))));return parseFloat((n/Math.pow(r,a)).toFixed(2))+" "+Gx[a]}function Dk(n){const r=Math.max(n.lastIndexOf("\\"),n.lastIndexOf("/"));return r===-1?"":n.slice(0,r)}function Mk(n){const r=[`File Properties: ${n.name}`,`Path: ${n.path}`,`Type: ${n.type}`,`Size: ${lb(n.size_bytes)}`,`Created: ${n.created}`,`Modified: ${n.modified}`];return n.md5&&r.push(`MD5: ${n.md5}`),n.sha256&&r.push(`SHA256: ${n.sha256}`),r.join(` -`)}function td(n,r,a){return n.length<=r+a+1?n:`${n.slice(0,r)}…${n.slice(-a)}`}function Ok(n){const r=n.includes("\\")?"\\":"/",a=n.split(/[\\/]/);return a.length<=5?n:[a[0],a[1],"…",a[a.length-2],a[a.length-1]].join(r)}const Rk=[{ms:1e3*60,unit:"minute"},{ms:1e3*60*60,unit:"hour"},{ms:1e3*60*60*24,unit:"day"},{ms:1e3*60*60*24*30,unit:"month"},{ms:1e3*60*60*24*365,unit:"year"}];function Qx(n,r=new Date){const a=new Date(n.replace(" ","T"));if(Number.isNaN(a.getTime()))return"just now";const u=r.getTime()-a.getTime();if(u<6e4)return"just now";let s="just now";for(const{ms:d,unit:f}of Rk){if(u{var V;n||((V=I.current)==null||V.focus(),v(!1))},[n]),_.useEffect(()=>{if(!n||!r)return;const V=new AbortController;return J.current=V,d(null),z(null),m(!0),x(null),(async()=>{try{const se=await y2(r.path,V.signal);if(J.current!==V)return;d(se)}catch(se){if(J.current!==V||se instanceof DOMException&&se.name==="AbortError")return;x(se instanceof Error?se.message:"Failed to load properties")}finally{J.current===V&&m(!1)}})(),()=>{J.current=null,V.abort()}},[n,r]),_.useEffect(()=>{if(!n)return;const V=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=V}},[n]),_.useEffect(()=>{if(!n)return;const V=se=>{if(se.key==="Escape"){if(w)return;a();return}if(se.key!=="Tab")return;const ve=$.current;if(!ve)return;const ae=Array.from(ve.querySelectorAll('button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(re=>re.offsetParent!==null);if(ae.length===0)return;const A=ae[0],W=ae[ae.length-1],le=document.activeElement instanceof HTMLElement?document.activeElement:null;se.shiftKey?(le===A||!ve.contains(le))&&(se.preventDefault(),W.focus()):le===W&&(se.preventDefault(),A.focus())};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[n,w,a]),_.useEffect(()=>{if(!n)return;const V=document.activeElement instanceof HTMLElement?document.activeElement:null;I.current=V;const se=requestAnimationFrame(()=>{var ve,ae;(ae=(ve=$.current)==null?void 0:ve.querySelector("button"))==null||ae.focus()});return()=>cancelAnimationFrame(se)},[n]);const ie=async(V,se)=>{try{await navigator.clipboard.writeText(V),g(se),setTimeout(()=>g(null),2e3)}catch(ve){console.error("Failed to copy:",ve)}},U=async(V,se,ve)=>{C(V),z(null);try{await ve(),z(se)}catch{z("Action failed")}finally{C(null)}},R=V=>`btn btn-chip rounded-md border px-3 py-2 text-xs ${{reveal:"bg-chip-sky-bg text-chip-sky-text border-chip-sky-border",launch:"border-emerald-500/30 bg-emerald-600 font-semibold text-white hover:bg-emerald-500",folder:"bg-chip-amber-bg text-chip-amber-text border-chip-amber-border"}[V]??"bg-chip-indigo-bg text-chip-indigo-text border-chip-indigo-border"}`,Q=(V,se,ve,ae=!1,A)=>h.jsxs("div",{className:"flex items-start gap-2 py-1.5 group",children:[h.jsxs("span",{className:"text-ink-muted min-w-[100px] text-xs",children:[V,":"]}),h.jsx("div",{className:"flex-1 min-w-0",children:h.jsx("span",{className:`text-ink text-xs break-all ${ae?"font-mono":""}`,children:A??se})}),h.jsx(He,{text:"Copy to clipboard",block:!1,children:h.jsx("button",{onClick:()=>ie(se,ve),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-elevated","aria-label":`Copy ${V}`,children:y===ve?h.jsx(vi,{className:"h-3.5 w-3.5 text-status-success-text"}):h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted"})})})]}),fe=(V,se,ve)=>h.jsxs("div",{className:"rounded-lg border border-line bg-elevated p-4",children:[h.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[se,h.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-ink-muted",children:V})]}),ve]}),B=()=>h.jsx(He,{text:"Click to copy full path",children:h.jsxs("button",{onClick:()=>void ie(s.path,"path"),className:"group mb-3 flex w-full items-center gap-2 rounded-lg border border-line bg-elevated px-3 py-2 text-left hover:bg-surface",children:[h.jsx(ss,{className:"text-chip-amber-text h-4 w-4 flex-shrink-0"}),h.jsx("span",{className:"text-ink min-w-0 flex-1 truncate font-mono text-xs",children:Ok(s.path)}),y==="path"?h.jsx(vi,{className:"text-status-success-text h-3.5 w-3.5"}):h.jsx(An,{className:"text-ink-muted h-3.5 w-3.5"})]})});if(!n||!r)return null;const ne=r;return h.jsxs("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 backdrop-blur-md p-4",role:"dialog","aria-modal":"true","aria-labelledby":"properties-modal-title",children:[h.jsx("div",{className:"absolute inset-0",onClick:a,onContextMenu:V=>{V.preventDefault(),a()}}),h.jsxs("div",{ref:$,className:"animate-modal-in relative w-full max-w-4xl max-h-[90vh] overflow-hidden rounded-xl border border-frame-line glass-panel flex flex-col",children:[h.jsx("div",{className:"flex-shrink-0 border-b border-line px-6 py-4",children:h.jsxs("div",{className:"flex items-start justify-between gap-4",children:[h.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[h.jsx("div",{className:"rounded-lg bg-indigo-600 p-2 flex-shrink-0",children:h.jsx(Wf,{className:"h-5 w-5 text-white"})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("h3",{id:"properties-modal-title",className:"text-base font-semibold text-ink truncate",children:"File Properties"}),h.jsx("p",{className:"text-xs text-ink-muted truncate",children:r.filename})]}),h.jsx(He,{text:"Copy all properties to clipboard",block:!1,children:h.jsx("button",{onClick:()=>{s&&ie(Mk(s),"all")},disabled:!s||f||p!==null,className:"btn-chip ml-2 flex items-center gap-1 rounded-md border border-chip-indigo-border bg-chip-indigo-bg p-1.5 text-chip-indigo-text","aria-label":"Copy all properties",children:y==="all"?h.jsx(vi,{className:"h-4 w-4 text-status-success-text"}):h.jsx(An,{className:"h-4 w-4"})})}),h.jsx(He,{text:"Generate Barcode/QR Code",block:!1,children:h.jsx("button",{onClick:()=>v(!0),className:"btn-chip rounded-md border border-chip-indigo-border bg-chip-indigo-bg p-1.5 text-chip-indigo-text",children:h.jsx(Gd,{className:"h-4 w-4"})})})]}),h.jsx("button",{onClick:a,className:"focus-ring rounded-md p-1 text-ink-muted hover:bg-elevated hover:text-ink flex-shrink-0","aria-label":"Close",children:h.jsx(nl,{className:"h-4 w-4"})})]})}),h.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:[f&&h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsxs("div",{className:"flex flex-col items-center gap-2",children:[h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-600 border-t-transparent"}),h.jsx("p",{className:"text-xs text-ink-muted",children:"Loading properties..."})]})}),p&&h.jsx("div",{className:"rounded-lg border border-status-danger-border bg-status-danger-bg p-4 text-center",children:h.jsx("p",{className:"text-xs text-status-danger-text",children:p})}),s&&!f&&!p&&h.jsxs("div",{children:[h.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-x-4 gap-y-1.5 rounded-lg border border-line bg-elevated px-4 py-2.5",children:[h.jsx("span",{className:"inline-flex items-center gap-1 rounded-md border border-chip-indigo-border bg-chip-indigo-bg px-2 py-0.5 text-xs font-semibold text-chip-indigo-text",children:s.type}),s.attributes.extension&&h.jsx("span",{className:"inline-flex items-center rounded-md border border-line bg-surface px-2 py-0.5 text-xs font-medium text-ink-muted",children:s.attributes.extension}),h.jsxs("span",{className:"text-xs text-ink-muted",title:`${s.size_bytes} bytes`,children:["Size ",h.jsx("strong",{className:"text-ink font-medium",children:lb(s.size_bytes)})]}),h.jsxs("span",{className:"text-xs text-ink-muted",title:s.created,children:["Created ",h.jsx("strong",{className:"text-ink font-medium",children:Qx(s.created)})]}),h.jsxs("span",{className:"text-xs text-ink-muted",title:s.modified,children:["Modified ",h.jsx("strong",{className:"text-ink font-medium",children:Qx(s.modified)})]}),s.md5&&h.jsx("span",{className:"inline-flex items-center rounded-md border border-chip-purple-border bg-chip-purple-bg px-2 py-0.5 font-mono text-xs font-medium text-chip-purple-text",title:`MD5 ${s.md5}`,children:td(s.md5,4,4)}),s.attributes.is_symlink&&h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-chip-fuchsia-border bg-chip-fuchsia-bg px-2 py-0.5 text-xs font-medium text-chip-fuchsia-text",children:[h.jsx(jw,{className:"h-3 w-3"})," Symlink"]})]}),B(),h.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[fe("Hashes",h.jsx(Zr,{className:"text-chip-purple-text h-3.5 w-3.5"}),h.jsxs("div",{className:"space-y-0.5",children:[Q("MD5",s.md5,"md5",!0,td(s.md5,10,6)),Q("SHA256",s.sha256,"sha256",!0,td(s.sha256,10,6))]})),fe("Timestamps",h.jsx(Y2,{className:"text-chip-sky-text h-3.5 w-3.5"}),h.jsxs("div",{className:"space-y-0.5",children:[Q("Created",s.created,"created",!0),Q("Modified",s.modified,"modified",!0)]})),fe("Identity",h.jsx(Wf,{className:"text-chip-indigo-text h-3.5 w-3.5"}),h.jsxs("div",{className:"space-y-0.5",children:[Q("Type",s.type,"type"),s.attributes.stem&&Q("Stem",s.attributes.stem,"attrStem"),Q("Extension",s.name.includes(".")?s.name.slice(s.name.lastIndexOf(".")):"None","extension"),Q("Directory",Dk(s.path)||"None","directory",!0)]})),fe("System",h.jsx(Wf,{className:"text-status-success-text h-3.5 w-3.5"}),h.jsxs("div",{children:[h.jsxs("div",{className:"mb-1 flex min-h-[24px] flex-wrap items-center gap-1.5",children:[s.attributes.is_readonly&&h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-status-danger-border bg-status-danger-bg px-2 py-0.5 text-xs text-status-danger-text",children:[h.jsx(_w,{className:"h-3 w-3"})," Read-only"]}),s.attributes.is_hidden&&h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-slate-500/30 bg-slate-600/20 px-2 py-0.5 text-xs text-slate-300",children:[h.jsx(sw,{className:"h-3 w-3"})," Hidden"]}),!s.attributes.is_readonly&&!s.attributes.is_hidden&&!s.attributes.is_symlink&&h.jsx("span",{className:"text-xs text-ink-muted",children:"No special flags"})]}),h.jsxs("div",{className:"space-y-0.5",children:[Q("File Type",s.attributes.is_file?"Regular File":s.attributes.is_dir?"Directory":"Other","fileType"),s.attributes.permissions&&Q("Permissions",s.attributes.permissions,"permissions",!0),s.attributes.owner_uid!==void 0&&Q("Owner UID",String(s.attributes.owner_uid),"ownerUid"),s.attributes.group_gid!==void 0&&Q("Group GID",String(s.attributes.group_gid),"groupGid")]})]}))]})]})]}),h.jsx("div",{className:"flex-shrink-0 border-t border-line px-6 py-3",children:h.jsxs("div",{className:"flex justify-between items-center gap-2",children:[h.jsx("p",{className:"min-w-0 text-xs text-ink-muted truncate",children:L??"Click the copy icon next to any field to copy its value"}),h.jsxs("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[h.jsx(He,{text:"Show file in Explorer",block:!1,children:h.jsxs("button",{onClick:()=>void U("reveal","Revealed in Explorer",()=>Yy(ne.path)),disabled:S!==null,className:R("reveal"),children:[h.jsx(vd,{className:"h-3.5 w-3.5"})," Reveal"]})}),h.jsx(He,{text:"Launch file with default association",block:!1,children:h.jsxs("button",{onClick:()=>{u&&(C("launch"),Promise.resolve(u(ne)).finally(()=>C(null)))},disabled:S!==null||!u,className:R("launch"),children:[h.jsx(er,{className:"h-3.5 w-3.5"})," Launch"]})}),h.jsx(He,{text:"Open containing folder",block:!1,children:h.jsxs("button",{onClick:()=>void U("folder","Opened folder",()=>yd(ne.path)),disabled:S!==null,className:R("folder"),children:[h.jsx(Ji,{className:"h-3.5 w-3.5"})," Open Folder"]})}),h.jsx("button",{onClick:a,className:"btn btn-primary px-4 py-2",children:"Close"})]})]})})]}),h.jsx(nb,{isOpen:w,onClose:()=>v(!1),initialFilePath:r.path,md5:s==null?void 0:s.md5})]})}const Uk=["qr_code","code_128","code_39","ean_13","ean_8","upc_a","upc_e","data_matrix"],Bk=250,Hk=400,qk=.7;function Fk(n,r=Hk,a=qk){const u=n.videoWidth,s=n.videoHeight;if(!u||!s)return null;const d=Math.min(u,s),f=document.createElement("canvas");f.width=Math.min(r,d),f.height=f.width;const m=f.getContext("2d");if(!m)return null;m.drawImage(n,(u-d)/2,(s-d)/2,d,d,0,0,f.width,f.height);const p=f.toDataURL("image/jpeg",a);return p.slice(p.indexOf(",")+1)}function Vk(n,r){const a=n.intervalMs??Bk;let u=!1,s=!1;const d=()=>{u=!0,clearInterval(f)},f=setInterval(()=>{if(u||s)return;const m=n.capture();m&&(s=!0,n.decode(m).then(p=>{u||p.decoded&&(d(),r.onDetected(p.decoded))}).catch(p=>{u||(d(),r.onError(p instanceof Error?p.message:"Frame decoding failed"))}).finally(()=>{s=!1}))},a);return d}const Yk=8e3;function Gk({isOpen:n,onClose:r,onDetected:a}){const u=_.useRef(null),s=_.useRef(null),d=Wr({isOpen:n,onClose:r,dialogRef:s}),f=_.useRef(null),m=_.useRef(null),p=_.useRef(null),[x,y]=_.useState(null),[g,w]=_.useState(!1),v=()=>{p.current&&(p.current(),p.current=null),m.current&&(cancelAnimationFrame(m.current),m.current=null),f.current&&(f.current.getTracks().forEach(L=>L.stop()),f.current=null),u.current&&(u.current.srcObject=null)};_.useEffect(()=>{if(!n){v(),y(null);return}let L=!0;async function z(){var I,J,ie,U,R;if(y(null),w(!1),typeof window<"u"&&!window.isSecureContext&&window.location.hostname!=="localhost"&&window.location.hostname!=="127.0.0.1"){y("Camera access requires HTTPS or localhost. If connecting across a local network IP (e.g. 192.168.x.x), modern browsers disable camera access for insecure HTTP.");return}const $=((J=(I=navigator.mediaDevices)==null?void 0:I.getUserMedia)==null?void 0:J.bind(navigator.mediaDevices))||((ie=navigator.getUserMedia)==null?void 0:ie.bind(navigator))||((U=navigator.webkitGetUserMedia)==null?void 0:U.bind(navigator))||((R=navigator.mozGetUserMedia)==null?void 0:R.bind(navigator));if(!$){y(window.isSecureContext?"Camera access is not supported by your browser or environment.":"Camera access is blocked because the page is not served over a secure origin (HTTPS or localhost/127.0.0.1).");return}try{let Q;const fe=await Promise.race([$({video:{facingMode:"environment",width:{ideal:1280},height:{ideal:720}}}),new Promise((B,ne)=>{Q=window.setTimeout(()=>ne(new DOMException("Camera did not start in time","TimeoutError")),Yk)})]).finally(()=>{Q!==void 0&&window.clearTimeout(Q)});if(!L){fe.getTracks().forEach(B=>B.stop());return}f.current=fe,u.current&&(u.current.srcObject=fe,await u.current.play()),"BarcodeDetector"in window?C():S()}catch(Q){if(!L)return;console.error("Camera access error:",Q),y(Q.name==="NotAllowedError"||Q.name==="PermissionDeniedError"?"Camera permission denied. Please allow camera access in your browser settings.":Q.name==="TimeoutError"?"The camera did not start in time. On macOS, camera capture needs the packaged desktop app — a bare Python process cannot access the camera. Alternatively, open ProFiles in Chrome, Edge or Safari.":`Could not access camera: ${Q.message||"Unknown error"}`)}}return z(),()=>{L=!1,v()}},[n]);const S=()=>{w(!0),p.current=Vk({capture:()=>u.current?Fk(u.current):null,decode:L=>x2({imageBase64:L,formats:[...Uk]})},{onDetected:L=>{v(),a(L)},onError:L=>{v(),y(L)}})},C=()=>{const L=["qr_code","code_128","code_39","ean_13","ean_8","upc_a","upc_e","data_matrix"];let z;try{z=new window.BarcodeDetector({formats:L})}catch(I){console.warn("BarcodeDetector formats unsupported:",I),z=new window.BarcodeDetector}const $=async()=>{if(!u.current||u.current.readyState<2){m.current=requestAnimationFrame($);return}try{const I=await z.detect(u.current);if(I&&I.length>0){const J=I[0].rawValue;if(J){v(),a(J);return}}}catch(I){console.debug("Frame detection error:",I)}m.current=requestAnimationFrame($)};m.current=requestAnimationFrame($)};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/70 p-4 backdrop-blur-sm",onClick:r,children:h.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-label":"Camera barcode scanner",onKeyDown:d,className:"relative w-full max-w-lg rounded-2xl border border-frame-line glass-panel p-6 flex flex-col",onClick:L=>L.stopPropagation(),children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink",children:[h.jsx(Xy,{className:"h-5 w-5 text-chip-indigo-text"}),h.jsx("span",{children:"Scan with Camera"})]}),h.jsx("button",{onClick:r,className:"focus-ring rounded-lg p-1 text-ink-muted hover:bg-elevated hover:text-ink transition-colors","aria-label":"Close",children:h.jsx(nl,{className:"h-4 w-4"})})]}),x?h.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[h.jsx("div",{className:"rounded-full bg-status-danger-bg p-3 text-status-danger-text mb-3",children:h.jsx(lu,{className:"h-6 w-6"})}),h.jsx("p",{className:"text-xs text-status-danger-text max-w-xs",children:x}),h.jsx("button",{onClick:r,className:"btn btn-secondary mt-6 px-4 py-2",children:"Close"})]}):h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsxs("div",{className:"relative aspect-video w-full overflow-hidden rounded-xl bg-black border border-line flex items-center justify-center",children:[h.jsx("video",{ref:u,playsInline:!0,muted:!0,className:"h-full w-full object-cover"}),h.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:h.jsxs("div",{className:"relative h-48 w-48 rounded-lg border-2 border-dashed border-indigo-400/80 bg-indigo-500/5 shadow-[0_0_0_9999px_rgba(0,0,0,0.45)]",children:[h.jsx("div",{className:"absolute top-0 left-0 h-4 w-4 border-t-2 border-l-2 border-indigo-400"}),h.jsx("div",{className:"absolute top-0 right-0 h-4 w-4 border-t-2 border-r-2 border-indigo-400"}),h.jsx("div",{className:"absolute bottom-0 left-0 h-4 w-4 border-b-2 border-l-2 border-indigo-400"}),h.jsx("div",{className:"absolute bottom-0 right-0 h-4 w-4 border-b-2 border-r-2 border-indigo-400"})]})})]}),h.jsx("p",{className:"mt-4 text-center text-xs text-ink-muted",children:g?"Hold a QR code or barcode steady in front of your camera — frames are decoded by the local ProFiles server (no native Barcode Detector in this browser).":"Hold a QR code or barcode steady in front of your camera to auto-scan."})]})]})}):null}function Qk({isOpen:n,file:r,onConfirm:a,onDismiss:u}){const s=_.useRef(null);return _.useEffect(()=>{var d;if(n){const f=m=>{m.key==="Enter"?(m.preventDefault(),a()):m.key==="Escape"&&(m.preventDefault(),u())};return window.addEventListener("keydown",f),(d=s.current)==null||d.focus(),()=>window.removeEventListener("keydown",f)}},[n,a,u]),!n||!r?null:h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",onClick:u,children:h.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":`1 file matched: ${r.filename}`,className:"animate-modal-in w-full max-w-sm rounded-xl border border-frame-line glass-panel p-5 flex flex-col gap-4",onClick:d=>d.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink text-sm",children:[r.has_hook?h.jsx(ek,{className:"h-4 w-4 text-chip-purple-text"}):h.jsx(er,{className:"h-4 w-4 text-status-success-text"}),h.jsx("span",{children:"1 File Matched"})]}),h.jsx("button",{onClick:u,className:"focus-ring rounded p-1 text-ink-muted hover:bg-elevated hover:text-ink","aria-label":"Dismiss",children:h.jsx(nl,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-line bg-elevated/50 p-3",children:[h.jsx(Pr,{className:"h-5 w-5 text-chip-indigo-text shrink-0 mt-0.5"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("h4",{className:"text-xs font-semibold text-ink truncate",children:r.filename}),h.jsx("p",{className:"text-[11px] text-ink-muted truncate mt-0.5",children:r.rel_path||r.path}),r.has_hook&&h.jsx("span",{className:"inline-block mt-1 text-[10px] text-chip-purple-text bg-chip-purple-bg px-1.5 py-0.5 rounded border border-chip-purple-border/50 font-medium",children:"Workflow Hook Configured"})]})]}),h.jsx("p",{className:"text-xs text-ink-muted text-center",children:"Launch this file now?"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{type:"button",onClick:u,className:"btn btn-secondary flex-1 px-3 py-1.5",children:"Dismiss (Esc)"}),h.jsxs("button",{ref:s,type:"button",onClick:a,className:"btn btn-primary flex-1 px-3 py-1.5 shadow-md",children:[h.jsx(er,{className:"h-3 w-3 fill-current"}),"Launch (Enter)"]})]})]})})}function Xk({systemInfo:n,fileCount:r,theme:a,onToggleTheme:u,onOpenLog:s,onOpenConfig:d,onLoadConfig:f,onShowShortcuts:m,onReloadConfig:p,onExport:x,exportDisabled:y=!1,language:g="en",onLanguageChange:w,activeConfigName:v,lanEnabled:S,onToggleLan:C}){return h.jsxs("footer",{className:"flex items-center justify-between border-t border-line bg-app px-4 py-2 text-[11px] text-ink-muted transition-colors duration-200",children:[h.jsx("div",{className:"flex items-center gap-4",children:n&&h.jsxs("div",{className:"flex items-center gap-1.5 rounded-full border border-line bg-surface px-2.5 py-0.5 text-ink-secondary",children:[h.jsx(z2,{className:"h-3 w-3 text-status-success-text"}),h.jsx("a",{href:`http://${n.hostname}:${window.location.port}`,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ProFiles on ${n.hostname}`,className:"font-mono hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 rounded px-1 py-0.5",children:n.hostname}),h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsx("a",{href:`http://${n.ip}:${window.location.port}`,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ProFiles on ${n.ip}`,className:"font-mono hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 rounded px-1 py-0.5",children:n.ip}),h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsxs("span",{className:"flex items-center gap-1",title:"Session user",children:[h.jsx(Jw,{className:"h-3 w-3 text-ink-faint"}),h.jsx("span",{children:n.username||"operator"})]}),C!==void 0&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsx(He,{text:"LAN access",block:!1,children:h.jsxs("button",{onClick:()=>C(S!==!0),disabled:S===null,"aria-pressed":S===!0,className:`focus-ring flex items-center gap-1 rounded px-1 py-0.5 text-[10px] ${S===null?"text-ink-faint cursor-not-allowed":S===!0?"text-status-success-text":"text-ink-muted hover:text-ink"}`,children:[h.jsx(Mw,{className:"h-3 w-3"}),h.jsx("span",{children:"LAN"})]})})]})]})}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("span",{children:[h.jsx("strong",{className:"text-ink",children:r})," files found"]}),h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsx(He,{text:"Keyboard shortcuts (?)",block:!1,children:h.jsxs("button",{onClick:m,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Zy,{className:"h-3 w-3"}),h.jsx("span",{children:"Shortcuts"})]})}),h.jsx(He,{text:"Open the application log viewer",block:!1,children:h.jsxs("button",{onClick:s,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Pr,{className:"h-3 w-3"}),h.jsx("span",{children:"Logs"})]})}),h.jsx("span",{className:"text-ink-faint",children:"|"}),p&&h.jsx(He,{text:"Reload configuration from disk",block:!1,children:h.jsxs("button",{onClick:p,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(cs,{className:"h-3 w-3"}),h.jsx("span",{children:"Reload"})]})}),x&&h.jsx(He,{text:"Export the current results as CSV",block:!1,children:h.jsxs("button",{onClick:x,disabled:y,className:"focus-ring flex items-center gap-1 rounded text-ink-muted hover:text-ink disabled:opacity-40 disabled:hover:text-ink-muted",children:[h.jsx(Iy,{className:"h-3 w-3"}),h.jsx("span",{children:"Export CSV"})]})}),w&&h.jsxs("div",{className:"flex items-center overflow-hidden rounded border border-line text-[10px]",children:[h.jsx(He,{text:"English",block:!1,children:h.jsxs("button",{onClick:()=>w("en"),className:`flex items-center gap-1 px-1.5 py-0.5 transition-colors ${g==="en"?"bg-indigo-600 text-white focus-ring":"text-ink-muted hover:text-ink focus-ring"}`,children:[h.jsx(vw,{className:"h-3 w-3"}),h.jsx("span",{children:"EN"})]})}),h.jsx(He,{text:"Français",block:!1,children:h.jsx("button",{onClick:()=>w("fr"),className:`flex items-center gap-1 px-1.5 py-0.5 transition-colors ${g==="fr"?"bg-indigo-600 text-white focus-ring":"text-ink-muted hover:text-ink focus-ring"}`,children:h.jsx("span",{children:"FR"})})})]}),f&&h.jsx(He,{text:v?`Load a different .profiles file (active: ${v})`:"Load a .profiles file",block:!1,children:h.jsxs("button",{onClick:f,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Kr,{className:"h-3 w-3"}),h.jsx("span",{children:"Load config…"})]})}),h.jsx(He,{text:"Open configuration file",block:!1,children:h.jsxs("button",{onClick:d,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Yw,{className:"h-3 w-3"}),h.jsx("span",{children:"Config"})]})}),h.jsx(He,{text:`Switch to ${a==="dark"?"light":"dark"} mode`,block:!1,children:h.jsxs("button",{onClick:u,className:"focus-ring flex items-center gap-1 rounded px-1.5 py-0.5 text-ink-muted hover:bg-elevated hover:text-status-warning-text",children:[a==="dark"?h.jsx(Qw,{className:"h-3 w-3 text-status-warning-text"}):h.jsx(zw,{className:"h-3 w-3 text-chip-indigo-text"}),h.jsx("span",{children:a==="dark"?"Light":"Dark"})]})})]})]})}const Ik=[{label:"5 seconds",seconds:5},{label:"10 seconds",seconds:10},{label:"30 seconds",seconds:30},{label:"1 minute",seconds:60},{label:"5 minutes",seconds:300}];function Kk({isOpen:n,currentInterval:r,onClose:a,onSetInterval:u}){const s=_.useRef(null),d=Wr({isOpen:n,onClose:a,dialogRef:s});if(!n)return null;const f=r>0,m=y=>{u(y)},p=y=>{y.preventDefault();const w=y.currentTarget.elements.namedItem("custom-interval"),v=parseInt(w.value,10);!isNaN(v)&&v>0&&u(v)},x=()=>{u(0)};return h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",children:h.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-label":"Auto-Rescan Timer",onKeyDown:d,className:"animate-modal-in w-[420px] max-w-full rounded-2xl border border-frame-line glass-panel p-5",children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink",children:[h.jsx(Jy,{className:"h-5 w-5 text-chip-indigo-text"}),h.jsx("span",{children:"Auto-Rescan Timer"})]}),h.jsx("button",{onClick:a,className:"focus-ring rounded-lg p-1 text-ink-muted hover:bg-elevated hover:text-ink",children:h.jsx(nl,{className:"h-4 w-4"})})]}),h.jsx("div",{className:"mb-4 rounded-lg bg-elevated/50 px-3 py-2 text-xs",children:f?h.jsxs("div",{className:"flex items-center gap-2 text-status-success-text",children:[h.jsx(ew,{className:"h-4 w-4 animate-pulse"}),h.jsxs("span",{children:["Auto-rescan every ",r,"s"]})]}):h.jsxs("div",{className:"flex items-center gap-2 text-ink-secondary",children:[h.jsx(P2,{className:"h-4 w-4"}),h.jsx("span",{children:"Auto-rescan is disabled"})]})}),h.jsxs("div",{className:"mb-4 space-y-1 text-xs",children:[h.jsx("p",{className:"text-ink-muted",children:"Presets:"}),h.jsx("div",{className:"grid grid-cols-2 gap-2",children:Ik.map(y=>h.jsx("button",{onClick:()=>m(y.seconds),className:"rounded-lg border border-line bg-elevated/50 px-3 py-1.5 text-left font-medium text-ink-secondary hover:border-chip-indigo-border hover:bg-chip-indigo-bg/40 hover:text-chip-indigo-text focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:y.label},y.seconds))})]}),h.jsxs("form",{onSubmit:p,className:"mb-4",children:[h.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-ink-secondary",children:[h.jsx(lw,{className:"h-3.5 w-3.5"}),h.jsx("span",{children:"Custom interval (seconds):"})]}),h.jsxs("div",{className:"mt-1 flex gap-2",children:[h.jsx("input",{type:"number",name:"custom-interval",min:"1",placeholder:"e.g. 45",className:"flex-1 rounded-lg border border-line bg-app px-2 py-1 text-xs text-ink placeholder-ink-faint focus:border-indigo-500 focus:outline-none"}),h.jsx("button",{type:"submit",className:"btn btn-primary rounded-lg px-3 py-1 font-semibold",children:"Set"})]})]}),f&&h.jsx("button",{onClick:x,className:"btn w-full rounded-lg border-line bg-elevated/50 px-3 py-2 text-status-warning-text hover:border-status-warning-border hover:bg-status-warning-bg/40",children:"Stop Auto-Rescan"}),h.jsx("div",{className:"flex justify-end gap-2 border-t border-line pt-3",children:h.jsx("button",{onClick:a,className:"rounded-lg border border-line bg-elevated px-4 py-2 text-xs font-semibold text-ink-secondary hover:bg-elevated/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:"Close"})})]})})}function Zk(n,r){const a={};return(n[n.length-1]===""?[...n,""]:n).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const $k=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Jk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pk={};function Xx(n,r){return(Pk.jsx?Jk:$k).test(n)}const Wk=/[ \t\n\f\r]/g;function eS(n){return typeof n=="object"?n.type==="text"?Ix(n.value):!1:Ix(n)}function Ix(n){return n.replace(Wk,"")===""}class ou{constructor(r,a,u){this.normal=a,this.property=r,u&&(this.space=u)}}ou.prototype.normal={};ou.prototype.property={};ou.prototype.space=void 0;function ib(n,r){const a={},u={};for(const s of n)Object.assign(a,s.property),Object.assign(u,s.normal);return new ou(a,u,r)}function Nd(n){return n.toLowerCase()}class yn{constructor(r,a){this.attribute=a,this.property=r}}yn.prototype.attribute="";yn.prototype.booleanish=!1;yn.prototype.boolean=!1;yn.prototype.commaOrSpaceSeparated=!1;yn.prototype.commaSeparated=!1;yn.prototype.defined=!1;yn.prototype.mustUseProperty=!1;yn.prototype.number=!1;yn.prototype.overloadedBoolean=!1;yn.prototype.property="";yn.prototype.spaceSeparated=!1;yn.prototype.space=void 0;let tS=0;const De=nr(),Ot=nr(),Ed=nr(),ce=nr(),ht=nr(),Pi=nr(),_n=nr();function nr(){return 2**++tS}const jd=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:Ot,commaOrSpaceSeparated:_n,commaSeparated:Pi,number:ce,overloadedBoolean:Ed,spaceSeparated:ht},Symbol.toStringTag,{value:"Module"})),nd=Object.keys(jd);class Qd extends yn{constructor(r,a,u,s){let d=-1;if(super(r,a),Kx(this,"space",s),typeof u=="number")for(;++d4&&a.slice(0,4)==="data"&&aS.test(r)){if(r.charAt(4)==="-"){const d=r.slice(5).replace(Zx,sS);u="data"+d.charAt(0).toUpperCase()+d.slice(1)}else{const d=r.slice(4);if(!Zx.test(d)){let f=d.replace(rS,oS);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}s=Qd}return new s(u,r)}function oS(n){return"-"+n.toLowerCase()}function sS(n){return n.charAt(1).toUpperCase()}const cS=ib([rb,nS,ob,sb,cb],"html"),Xd=ib([rb,lS,ob,sb,cb],"svg");function fS(n){return n.join(" ").trim()}var $x=/\/\*(?:[^*]|\*(?!\/))*\*\//g,dS=/\n/g,hS=/^\s*/,mS=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,pS=/^:\s*/,gS=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,xS=/^[;\s]*/,yS=` -`,Jx="/",Px="*",Pa="",bS="comment",vS="declaration";function wS(n,r){if(typeof n!="string")throw new TypeError("First argument must be a string");if(!n)return[];r=r||{};var a=1,u=1;function s(S){var C=S.match(dS);C&&(a+=C.length);var L=S.lastIndexOf(yS);u=~L?S.length-L:u+S.length}function d(){var S={line:a,column:u};return function(C){return C.position=new f(S),x(),C}}function f(S){this.start=S,this.end={line:a,column:u},this.source=r.source}f.prototype.content=n;function m(S){var C=new Error(r.source+":"+a+":"+u+": "+S);if(C.reason=S,C.filename=r.source,C.line=a,C.column=u,C.source=n,!r.silent)throw C}function p(S){var C=S.exec(n);if(C){var L=C[0];return s(L),n=n.slice(L.length),C}}function x(){p(hS)}function y(S){for(var C;C=g();)S.push(C);return S}function g(){var S=d();if(!(Jx!=n.charAt(0)||Px!=n.charAt(1))){for(var C=2;Pa!=n.charAt(C)&&(Px!=n.charAt(C)||Jx!=n.charAt(C+1));)++C;if(C+=2,Pa===n.charAt(C-1))return m("End of comment missing");var L=n.slice(2,C-2);return u+=2,s(L),n=n.slice(C),u+=2,S({type:bS,comment:L})}}function w(){var S=d(),C=p(mS);if(C){if(g(),!p(pS))return m("property missing ':'");var L=p(gS),z=S({type:vS,property:C[0].replace($x,Pa).trim(),value:L?L[0].replace($x,Pa).trim():Pa});return p(xS),z}}function v(){var S=[];y(S);for(var C;C=w();)S.push(C),y(S);return S}return x(),v()}function kS(n,r){let a=null;if(!n||typeof n!="string")return a;const u=wS(n),s=typeof r=="function";return u.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:m}=d;s?r(f,m,d):m&&(a=a??{},a[f]=m)}),a}const fb=db("end"),Id=db("start");function db(n){return r;function r(a){const u=a&&a.position&&a.position[n]||{};if(typeof u.line=="number"&&u.line>0&&typeof u.column=="number"&&u.column>0)return{line:u.line,column:u.column,offset:typeof u.offset=="number"&&u.offset>-1?u.offset:void 0}}}function SS(n){const r=Id(n),a=fb(n);if(r&&a)return{start:r,end:a}}function iu(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?Wx(n.position):"start"in n||"end"in n?Wx(n):"line"in n||"column"in n?Cd(n):""}function Cd(n){return ey(n&&n.line)+":"+ey(n&&n.column)}function Wx(n){return Cd(n&&n.start)+"-"+Cd(n&&n.end)}function ey(n){return n&&typeof n=="number"?n:1}class an extends Error{constructor(r,a,u){super(),typeof a=="string"&&(u=a,a=void 0);let s="",d={},f=!1;if(a&&("line"in a&&"column"in a?d={place:a}:"start"in a&&"end"in a?d={place:a}:"type"in a?d={ancestors:[a],place:a.position}:d={...a}),typeof r=="string"?s=r:!d.cause&&r&&(f=!0,s=r.message,d.cause=r),!d.ruleId&&!d.source&&typeof u=="string"){const p=u.indexOf(":");p===-1?d.ruleId=u:(d.source=u.slice(0,p),d.ruleId=u.slice(p+1))}if(!d.place&&d.ancestors&&d.ancestors){const p=d.ancestors[d.ancestors.length-1];p&&(d.place=p.position)}const m=d.place&&"start"in d.place?d.place.start:d.place;this.ancestors=d.ancestors||void 0,this.cause=d.cause||void 0,this.column=m?m.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=m?m.line:void 0,this.name=iu(d.place)||"1:1",this.place=d.place||void 0,this.reason=this.message,this.ruleId=d.ruleId||void 0,this.source=d.source||void 0,this.stack=f&&d.cause&&typeof d.cause.stack=="string"?d.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}an.prototype.file="";an.prototype.name="";an.prototype.reason="";an.prototype.message="";an.prototype.stack="";an.prototype.column=void 0;an.prototype.line=void 0;an.prototype.ancestors=void 0;an.prototype.cause=void 0;an.prototype.fatal=void 0;an.prototype.place=void 0;an.prototype.ruleId=void 0;an.prototype.source=void 0;const Kd={}.hasOwnProperty,NS=new Map,ES=/[A-Z]/g,jS=/-([a-z])/g,CS=new Set(["table","tbody","thead","tfoot","tr"]),TS=new Set(["td","th"]),hb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function _S(n,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=r.filePath||void 0;let u;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");u=US(a,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");u=LS(a,r.jsx,r.jsxs)}const s={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:u,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?Xd:cS,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},d=mb(s,n,void 0);return d&&typeof d!="string"?d:s.create(n,s.Fragment,{children:d||void 0},void 0)}function mb(n,r,a){if(r.type==="element")return AS(n,r,a);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return zS(n,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return MS(n,r,a);if(r.type==="mdxjsEsm")return DS(n,r);if(r.type==="root")return OS(n,r,a);if(r.type==="text")return RS(n,r)}function AS(n,r,a){const u=n.schema;let s=u;r.tagName.toLowerCase()==="svg"&&u.space==="html"&&(s=Xd,n.schema=s),n.ancestors.push(r);const d=gb(n,r.tagName,!1),f=BS(n,r);let m=$d(n,r);return CS.has(r.tagName)&&(m=m.filter(function(p){return typeof p=="string"?!eS(p):!0})),pb(n,f,d,r),Zd(f,m),n.ancestors.pop(),n.schema=u,n.create(r,d,f,a)}function zS(n,r){if(r.data&&r.data.estree&&n.evaluater){const u=r.data.estree.body[0];return u.type,n.evaluater.evaluateExpression(u.expression)}uu(n,r.position)}function DS(n,r){if(r.data&&r.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(r.data.estree);uu(n,r.position)}function MS(n,r,a){const u=n.schema;let s=u;r.name==="svg"&&u.space==="html"&&(s=Xd,n.schema=s),n.ancestors.push(r);const d=r.name===null?n.Fragment:gb(n,r.name,!0),f=HS(n,r),m=$d(n,r);return pb(n,f,d,r),Zd(f,m),n.ancestors.pop(),n.schema=u,n.create(r,d,f,a)}function OS(n,r,a){const u={};return Zd(u,$d(n,r)),n.create(r,n.Fragment,u,a)}function RS(n,r){return r.value}function pb(n,r,a,u){typeof a!="string"&&a!==n.Fragment&&n.passNode&&(r.node=u)}function Zd(n,r){if(r.length>0){const a=r.length>1?r:r[0];a&&(n.children=a)}}function LS(n,r,a){return u;function u(s,d,f,m){const x=Array.isArray(f.children)?a:r;return m?x(d,f,m):x(d,f)}}function US(n,r){return a;function a(u,s,d,f){const m=Array.isArray(d.children),p=Id(u);return r(s,d,f,m,{columnNumber:p?p.column-1:void 0,fileName:n,lineNumber:p?p.line:void 0},void 0)}}function BS(n,r){const a={};let u,s;for(s in r.properties)if(s!=="children"&&Kd.call(r.properties,s)){const d=qS(n,s,r.properties[s]);if(d){const[f,m]=d;n.tableCellAlignToStyle&&f==="align"&&typeof m=="string"&&TS.has(r.tagName)?u=m:a[f]=m}}if(u){const d=a.style||(a.style={});d[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=u}return a}function HS(n,r){const a={};for(const u of r.attributes)if(u.type==="mdxJsxExpressionAttribute")if(u.data&&u.data.estree&&n.evaluater){const d=u.data.estree.body[0];d.type;const f=d.expression;f.type;const m=f.properties[0];m.type,Object.assign(a,n.evaluater.evaluateExpression(m.argument))}else uu(n,r.position);else{const{name:s}=u;let d;if(u.value&&typeof u.value=="object")if(u.value.data&&u.value.data.estree&&n.evaluater){const m=u.value.data.estree.body[0];m.type,d=n.evaluater.evaluateExpression(m.expression)}else uu(n,r.position);else d=u.value===null?!0:u.value;a[s]=d}return a}function $d(n,r){const a=[];let u=-1;const s=n.passKeys?new Map:NS;for(;++us?0:s+r:r=r>s?s:r,a=a>0?a:0,u.length<1e4)f=Array.from(u),f.unshift(r,a),n.splice(...f);else for(a&&n.splice(r,a);d0?(el(n,n.length,0,r),n):r}const ly={}.hasOwnProperty;function yb(n){const r={};let a=-1;for(;++a13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function tl(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Pt=ki(/[A-Za-z]/),Wt=ki(/[\dA-Za-z]/),$S=ki(/[#-'*+\--9=?A-Z^-~]/);function is(n){return n!==null&&(n<32||n===127)}const Td=ki(/\d/),JS=ki(/[\dA-Fa-f]/),vb=ki(/[!-/:-@[-`{-~]/);function Te(n){return n!==null&&n<-2}function mt(n){return n!==null&&(n<0||n===32)}function Ve(n){return n===-2||n===-1||n===32}const fs=ki(new RegExp("\\p{P}|\\p{S}","u")),tr=ki(/\s/);function ki(n){return r;function r(a){return a!==null&&a>-1&&n.test(String.fromCharCode(a))}}function ta(n){const r=[];let a=-1,u=0,s=0;for(;++a55295&&d<57344){const m=n.charCodeAt(a+1);d<56320&&m>56319&&m<57344?(f=String.fromCharCode(d,m),s=1):f="�"}else f=String.fromCharCode(d);f&&(r.push(n.slice(u,a),encodeURIComponent(f)),u=a+s+1,f=""),s&&(a+=s,s=0)}return r.join("")+n.slice(u)}function et(n,r,a,u){const s=u?u-1:1/0;let d=0;return f;function f(p){return Ve(p)?(n.enter(a),m(p)):r(p)}function m(p){return Ve(p)&&d++=s?r(y):a(y)}}const PS={tokenize:WS};function WS(n){const r=n.attempt(this.parser.constructs.contentInitial,u,s);let a;return r;function u(m){if(m===null){n.consume(m);return}return n.enter("lineEnding"),n.consume(m),n.exit("lineEnding"),et(n,r,"linePrefix")}function s(m){return n.enter("paragraph"),d(m)}function d(m){const p=n.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=p),a=p,f(m)}function f(m){if(m===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(m);return}return Te(m)?(n.consume(m),n.exit("chunkText"),d):(n.consume(m),f)}}let rs=class{constructor(){this.index=new Map,this.map=[]}add(r,a,u){iy(this,r,a,u,!1)}addBefore(r,a,u){iy(this,r,a,u,!0)}consume(r){if(this.map.sort(function(d,f){return d[0]-f[0]}),this.map.length===0)return;let a=this.map.length;const u=[];for(;a>0;)a-=1,u.push(r.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),r.length=this.map[a][0];u.push(r.slice()),r.length=0;let s=u.pop();for(;s;){for(const d of s)r.push(d);s=u.pop()}this.map.length=0,this.index.clear()}};function iy(n,r,a,u,s){if(a===0&&u.length===0)return;const d=n.index.get(r);if(d){d[1]+=a,s?(u.push(...d[2]),d[2]=u):d[2].push(...u);return}const f=[r,a,u];n.map.push(f),n.index.set(r,f)}const eN={tokenize:tN},ry={tokenize:nN};function tN(n){const r=this,a=[];let u=0,s,d,f;return m;function m(I){if(uf))return;const R=r.events.length;let Q=R,fe,B;for(;Q--;)if(r.events[Q][0]==="exit"&&r.events[Q][1].type==="chunkFlow"){if(fe){B=r.events[Q][1].end;break}fe=!0}for(z(u),U=R;UI;){const ie=a[J];r.containerState=ie[1],ie[0].exit.call(r,n)}a.length=I}function $(){s.write([null]),d=void 0,s=void 0,r.containerState._closeFlow=void 0}}function nN(n,r,a){return et(n,n.attempt(this.parser.constructs.document,r,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wi(n){if(n===null||mt(n)||tr(n))return 1;if(fs(n))return 2}function ds(n,r,a){const u=[];let s=-1;for(;++s1&&n[a][1].end.offset-n[a][1].start.offset>1?2:1,f={...n[s][1].end},m={...n[a][1].start};ay(f,-d),ay(m,d);const p={type:d>1?"strongSequence":"emphasisSequence",start:f,end:{...n[s][1].end}},x={type:d>1?"strongSequence":"emphasisSequence",start:{...n[a][1].start},end:m},y={type:d>1?"strongText":"emphasisText",start:{...n[s][1].end},end:{...n[a][1].start}},g={type:d>1?"strong":"emphasis",start:{...p.start},end:{...x.end}};n[s][1].end={...p.start},n[a][1].start={...x.end},u=[],n[s][1].end.offset-n[s][1].start.offset&&(u=Yn(u,[["enter",n[s][1],r],["exit",n[s][1],r]])),u=Yn(u,[["enter",g,r],["enter",p,r],["exit",p,r],["enter",y,r]]),u=Yn(u,ds(r.parser.constructs.insideSpan.null,n.slice(s+1,a),r)),u=Yn(u,[["exit",y,r],["enter",x,r],["exit",x,r],["exit",g,r]]);let w=0;n[a][1].end.offset-n[a][1].start.offset&&(w=2,u=Yn(u,[["enter",n[a][1],r],["exit",n[a][1],r]])),el(n,s-1,a-s+3,u),a=s+u.length-w-2;break}}for(a=-1;++a0&&Ve(U)?et(n,$,"linePrefix",d+1)(U):$(U)}function $(U){return U===null||Te(U)?n.check(Ad,C,J)(U):(n.enter("codeFlowValue"),I(U))}function I(U){return U===null||Te(U)?(n.exit("codeFlowValue"),$(U)):(n.consume(U),I)}function J(U){return n.exit("codeFenced"),r(U)}function ie(U,R,Q){let fe=0;return B;function B(ae){return U.enter("lineEnding"),U.consume(ae),U.exit("lineEnding"),ne}function ne(ae){return U.enter("codeFencedFence"),Ve(ae)?et(U,V,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ae):V(ae)}function V(ae){return ae===m?(U.enter("codeFencedFenceSequence"),se(ae)):Q(ae)}function se(ae){return ae===m?(fe++,U.consume(ae),se):fe>=f?(U.exit("codeFencedFenceSequence"),Ve(ae)?et(U,ve,"whitespace")(ae):ve(ae)):Q(ae)}function ve(ae){return ae===null||Te(ae)?(U.exit("codeFencedFence"),R(ae)):Q(ae)}}}const id={name:"codeIndented",tokenize:gN},pN={partial:!0,tokenize:xN};function gN(n,r,a){return u;function u(m){return n.enter("codeIndented"),wb(n,s,a,"linePrefix",4,4)(m)}function s(m){return m===null?f(m):Te(m)?n.attempt(pN,s,f)(m):(n.enter("codeFlowValue"),d(m))}function d(m){return m===null||Te(m)?(n.exit("codeFlowValue"),s(m)):(n.consume(m),d)}function f(m){return n.exit("codeIndented"),r(m)}}function xN(n,r,a){const u=this;return s;function s(f){return u.parser.lazy[u.now().line]?a(f):Te(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),s):wb(n,r,d,"linePrefix",4,4)(f)}function d(f){return Te(f)?s(f):a(f)}}const yN={name:"codeText",previous:vN,resolve:bN,tokenize:wN};function bN(n){let r=n.length-4,a=3,u,s;if((n[a][1].type==="lineEnding"||n[a][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(u=a;++u=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return rthis.left.length?this.right.slice(this.right.length-u+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-u+this.left.length).reverse())}splice(r,a,u){const s=a||0;this.setCursor(Math.trunc(r));const d=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return u&&Wa(this.left,u),d.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),Wa(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Wa(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r=4?r(f):n.interrupt(u.parser.constructs.flow,a,r)(f)}}function jb(n,r,a,u,s,d,f,m,p){const x=p||Number.POSITIVE_INFINITY;let y=0;return g;function g(z){return z===60?(n.enter(u),n.enter(s),n.enter(d),n.consume(z),n.exit(d),w):z===null||z===32||z===41||is(z)?a(z):(n.enter(u),n.enter(f),n.enter(m),n.enter("chunkString",{contentType:"string"}),C(z))}function w(z){return z===62?(n.enter(d),n.consume(z),n.exit(d),n.exit(s),n.exit(u),r):(n.enter(m),n.enter("chunkString",{contentType:"string"}),v(z))}function v(z){return z===62?(n.exit("chunkString"),n.exit(m),w(z)):z===null||z===60||Te(z)?a(z):(n.consume(z),z===92?S:v)}function S(z){return z===60||z===62||z===92?(n.consume(z),v):v(z)}function C(z){return!y&&(z===null||z===41||mt(z))?(n.exit("chunkString"),n.exit(m),n.exit(f),n.exit(u),r(z)):y999||v===null||v===91||v===93&&!p||v===94&&!m&&"_hiddenFootnoteSupport"in f.parser.constructs?a(v):v===93?(n.exit(d),n.enter(s),n.consume(v),n.exit(s),n.exit(u),r):Te(v)?(n.enter("lineEnding"),n.consume(v),n.exit("lineEnding"),y):(n.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||v===91||v===93||Te(v)||m++>999?(n.exit("chunkString"),y(v)):(n.consume(v),p||(p=!Ve(v)),v===92?w:g)}function w(v){return v===91||v===92||v===93?(n.consume(v),m++,g):g(v)}}function Tb(n,r,a,u,s,d){let f;return m;function m(w){return w===34||w===39||w===40?(n.enter(u),n.enter(s),n.consume(w),n.exit(s),f=w===40?41:w,p):a(w)}function p(w){return w===f?(n.enter(s),n.consume(w),n.exit(s),n.exit(u),r):(n.enter(d),x(w))}function x(w){return w===f?(n.exit(d),p(f)):w===null?a(w):Te(w)?(n.enter("lineEnding"),n.consume(w),n.exit("lineEnding"),et(n,x,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),y(w))}function y(w){return w===f||w===null||Te(w)?(n.exit("chunkString"),x(w)):(n.consume(w),w===92?g:y)}function g(w){return w===f||w===92?(n.consume(w),y):y(w)}}function ru(n,r){let a;return u;function u(s){return Te(s)?(n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),a=!0,u):Ve(s)?et(n,u,a?"linePrefix":"lineSuffix")(s):r(s)}}const _N={name:"definition",tokenize:zN},AN={partial:!0,tokenize:DN};function zN(n,r,a){const u=this;let s;return d;function d(v){return n.enter("definition"),f(v)}function f(v){return Cb.call(u,n,m,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function m(v){return s=tl(u.sliceSerialize(u.events[u.events.length-1][1]).slice(1,-1)),v===58?(n.enter("definitionMarker"),n.consume(v),n.exit("definitionMarker"),p):a(v)}function p(v){return mt(v)?ru(n,x)(v):x(v)}function x(v){return jb(n,y,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function y(v){return n.attempt(AN,g,g)(v)}function g(v){return Ve(v)?et(n,w,"whitespace")(v):w(v)}function w(v){return v===null||Te(v)?(n.exit("definition"),u.parser.defined.push(s),r(v)):a(v)}}function DN(n,r,a){return u;function u(m){return mt(m)?ru(n,s)(m):a(m)}function s(m){return Tb(n,d,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(m)}function d(m){return Ve(m)?et(n,f,"whitespace")(m):f(m)}function f(m){return m===null||Te(m)?r(m):a(m)}}const MN={name:"hardBreakEscape",tokenize:ON};function ON(n,r,a){return u;function u(d){return n.enter("hardBreakEscape"),n.consume(d),s}function s(d){return Te(d)?(n.exit("hardBreakEscape"),r(d)):a(d)}}const RN={name:"headingAtx",resolve:LN,tokenize:UN};function LN(n,r){let a=n.length-2,u=3;if(n[u][1].type==="whitespace"&&(u+=2),a-2>u&&n[a][1].type==="whitespace"&&(a-=2),n[a][1].type==="atxHeadingSequence"&&(u===a-1||a-4>u&&n[a-2][1].type==="whitespace")&&(a-=u+1===a?2:4),a>u){const s={type:"atxHeadingText",start:n[u][1].start,end:n[a][1].end},d={type:"chunkText",start:n[u][1].start,end:n[a][1].end,contentType:"text"};el(n,u,a-u+1,[["enter",s,r],["enter",d,r],["exit",d,r],["exit",s,r]])}return n}function UN(n,r,a){let u=0;return s;function s(y){return n.enter("atxHeading"),d(y)}function d(y){return n.enter("atxHeadingSequence"),f(y)}function f(y){return y===35&&u++<6?(n.consume(y),f):y===null||mt(y)?(n.exit("atxHeadingSequence"),m(y)):a(y)}function m(y){return y===35?(n.enter("atxHeadingSequence"),p(y)):y===null||Te(y)?(n.exit("atxHeading"),r(y)):Ve(y)?et(n,m,"whitespace")(y):(n.enter("atxHeadingText"),x(y))}function p(y){return y===35?(n.consume(y),p):(n.exit("atxHeadingSequence"),m(y))}function x(y){return y===null||y===35||mt(y)?(n.exit("atxHeadingText"),m(y)):(n.consume(y),x)}}const _b=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],zd=["pre","script","style","textarea"],BN={concrete:!0,name:"htmlFlow",resolveTo:qN,tokenize:FN},HN={partial:!0,tokenize:VN};function qN(n){let r=n.length;for(;r--&&!(n[r][0]==="enter"&&n[r][1].type==="htmlFlow"););return r>1&&n[r-2][1].type==="linePrefix"&&(n[r][1].start=n[r-2][1].start,n[r+1][1].start=n[r-2][1].start,n.splice(r-2,2)),n}function FN(n,r,a){const u=this;let s,d,f,m,p;return x;function x(M){return y(M)}function y(M){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(M),g}function g(M){return M===33?(n.consume(M),w):M===47?(n.consume(M),d=!0,C):M===63?(n.consume(M),s=3,u.interrupt?r:N):Pt(M)?(n.consume(M),f=String.fromCharCode(M),L):a(M)}function w(M){return M===45?(n.consume(M),s=2,v):M===91?(n.consume(M),s=5,m=0,S):Pt(M)?(n.consume(M),s=4,u.interrupt?r:N):a(M)}function v(M){return M===45?(n.consume(M),u.interrupt?r:N):a(M)}function S(M){const E="CDATA[";return M===E.charCodeAt(m++)?(n.consume(M),m===E.length?u.interrupt?r:V:S):a(M)}function C(M){return Pt(M)?(n.consume(M),f=String.fromCharCode(M),L):a(M)}function L(M){if(M===null||M===47||M===62||mt(M)){const E=M===47,Y=f.toLowerCase();return!E&&!d&&zd.includes(Y)?(s=1,u.interrupt?r(M):V(M)):_b.includes(f.toLowerCase())?(s=6,E?(n.consume(M),z):u.interrupt?r(M):V(M)):(s=7,u.interrupt&&!u.parser.lazy[u.now().line]?a(M):d?$(M):I(M))}return M===45||Wt(M)?(n.consume(M),f+=String.fromCharCode(M),L):a(M)}function z(M){return M===62?(n.consume(M),u.interrupt?r:V):a(M)}function $(M){return Ve(M)?(n.consume(M),$):B(M)}function I(M){return M===47?(n.consume(M),B):M===58||M===95||Pt(M)?(n.consume(M),J):Ve(M)?(n.consume(M),I):B(M)}function J(M){return M===45||M===46||M===58||M===95||Wt(M)?(n.consume(M),J):ie(M)}function ie(M){return M===61?(n.consume(M),U):Ve(M)?(n.consume(M),ie):I(M)}function U(M){return M===null||M===60||M===61||M===62||M===96?a(M):M===34||M===39?(n.consume(M),p=M,R):Ve(M)?(n.consume(M),U):Q(M)}function R(M){return M===p?(n.consume(M),p=null,fe):M===null||Te(M)?a(M):(n.consume(M),R)}function Q(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||mt(M)?ie(M):(n.consume(M),Q)}function fe(M){return M===47||M===62||Ve(M)?I(M):a(M)}function B(M){return M===62?(n.consume(M),ne):a(M)}function ne(M){return M===null||Te(M)?V(M):Ve(M)?(n.consume(M),ne):a(M)}function V(M){return M===45&&s===2?(n.consume(M),A):M===60&&s===1?(n.consume(M),W):M===62&&s===4?(n.consume(M),qe):M===63&&s===3?(n.consume(M),N):M===93&&s===5?(n.consume(M),re):Te(M)&&(s===6||s===7)?(n.exit("htmlFlowData"),n.check(HN,Ge,se)(M)):M===null||Te(M)?(n.exit("htmlFlowData"),se(M)):(n.consume(M),V)}function se(M){return n.check(Ad,ve,Ge)(M)}function ve(M){return n.enter("lineEnding"),n.consume(M),n.exit("lineEnding"),ae}function ae(M){return M===null||Te(M)?se(M):(n.enter("htmlFlowData"),V(M))}function A(M){return M===45?(n.consume(M),N):V(M)}function W(M){return M===47?(n.consume(M),f="",le):V(M)}function le(M){if(M===62){const E=f.toLowerCase();return zd.includes(E)?(n.consume(M),qe):V(M)}return Pt(M)&&f.length<8?(n.consume(M),f+=String.fromCharCode(M),le):V(M)}function re(M){return M===93?(n.consume(M),N):V(M)}function N(M){return M===62?(n.consume(M),qe):M===45&&s===2?(n.consume(M),N):V(M)}function qe(M){return M===null||Te(M)?(n.exit("htmlFlowData"),Ge(M)):(n.consume(M),qe)}function Ge(M){return n.exit("htmlFlow"),r(M)}}function VN(n,r,a){return u;function u(s){return n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),n.attempt(su,r,a)}}const YN={name:"htmlText",tokenize:GN};function GN(n,r,a){const u=this;let s,d,f;return m;function m(N){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(N),p}function p(N){return N===33?(n.consume(N),x):N===47?(n.consume(N),ie):N===63?(n.consume(N),I):Pt(N)?(n.consume(N),Q):a(N)}function x(N){return N===45?(n.consume(N),y):N===91?(n.consume(N),d=0,S):Pt(N)?(n.consume(N),$):a(N)}function y(N){return N===45?(n.consume(N),v):a(N)}function g(N){return N===null?a(N):N===45?(n.consume(N),w):Te(N)?(f=g,W(N)):(n.consume(N),g)}function w(N){return N===45?(n.consume(N),v):g(N)}function v(N){return N===62?A(N):N===45?w(N):g(N)}function S(N){const qe="CDATA[";return N===qe.charCodeAt(d++)?(n.consume(N),d===qe.length?C:S):a(N)}function C(N){return N===null?a(N):N===93?(n.consume(N),L):Te(N)?(f=C,W(N)):(n.consume(N),C)}function L(N){return N===93?(n.consume(N),z):C(N)}function z(N){return N===62?A(N):N===93?(n.consume(N),z):C(N)}function $(N){return N===null||N===62?A(N):Te(N)?(f=$,W(N)):(n.consume(N),$)}function I(N){return N===null?a(N):N===63?(n.consume(N),J):Te(N)?(f=I,W(N)):(n.consume(N),I)}function J(N){return N===62?A(N):I(N)}function ie(N){return Pt(N)?(n.consume(N),U):a(N)}function U(N){return N===45||Wt(N)?(n.consume(N),U):R(N)}function R(N){return Te(N)?(f=R,W(N)):Ve(N)?(n.consume(N),R):A(N)}function Q(N){return N===45||Wt(N)?(n.consume(N),Q):N===47||N===62||mt(N)?fe(N):a(N)}function fe(N){return N===47?(n.consume(N),A):N===58||N===95||Pt(N)?(n.consume(N),B):Te(N)?(f=fe,W(N)):Ve(N)?(n.consume(N),fe):A(N)}function B(N){return N===45||N===46||N===58||N===95||Wt(N)?(n.consume(N),B):ne(N)}function ne(N){return N===61?(n.consume(N),V):Te(N)?(f=ne,W(N)):Ve(N)?(n.consume(N),ne):fe(N)}function V(N){return N===null||N===60||N===61||N===62||N===96?a(N):N===34||N===39?(n.consume(N),s=N,se):Te(N)?(f=V,W(N)):Ve(N)?(n.consume(N),V):(n.consume(N),ve)}function se(N){return N===s?(n.consume(N),s=void 0,ae):N===null?a(N):Te(N)?(f=se,W(N)):(n.consume(N),se)}function ve(N){return N===null||N===34||N===39||N===60||N===61||N===96?a(N):N===47||N===62||mt(N)?fe(N):(n.consume(N),ve)}function ae(N){return N===47||N===62||mt(N)?fe(N):a(N)}function A(N){return N===62?(n.consume(N),n.exit("htmlTextData"),n.exit("htmlText"),r):a(N)}function W(N){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(N),n.exit("lineEnding"),le}function le(N){return Ve(N)?et(n,re,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):re(N)}function re(N){return n.enter("htmlTextData"),f(N)}}const Wd={name:"labelEnd",resolveAll:KN,resolveTo:ZN,tokenize:$N},QN={tokenize:JN},XN={tokenize:PN},IN={tokenize:WN};function KN(n){let r=-1;const a=[];for(;++r0&&s[s.length-1]._balanced;)s.pop();d=s[s.length-1]}return m;function m(w){return d?d._inactive?g(w):(f=u.parser.defined.includes(tl(u.sliceSerialize({start:d.end,end:u.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(w),n.exit("labelMarker"),n.exit("labelEnd"),p):a(w)}function p(w){return w===40?n.attempt(QN,y,f?y:g)(w):w===91?n.attempt(XN,y,f?x:g)(w):f?y(w):g(w)}function x(w){return n.attempt(IN,y,g)(w)}function y(w){return s.pop(),r(w)}function g(w){return d._balanced=!0,a(w)}}function JN(n,r,a){return u;function u(g){return n.enter("resource"),n.enter("resourceMarker"),n.consume(g),n.exit("resourceMarker"),s}function s(g){return mt(g)?ru(n,d)(g):d(g)}function d(g){return g===41?y(g):jb(n,f,m,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function f(g){return mt(g)?ru(n,p)(g):y(g)}function m(g){return a(g)}function p(g){return g===34||g===39||g===40?Tb(n,x,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function x(g){return mt(g)?ru(n,y)(g):y(g)}function y(g){return g===41?(n.enter("resourceMarker"),n.consume(g),n.exit("resourceMarker"),n.exit("resource"),r):a(g)}}function PN(n,r,a){const u=this;return s;function s(m){return Cb.call(u,n,d,f,"reference","referenceMarker","referenceString")(m)}function d(m){return u.parser.defined.includes(tl(u.sliceSerialize(u.events[u.events.length-1][1]).slice(1,-1)))?r(m):a(m)}function f(m){return a(m)}}function WN(n,r,a){return u;function u(d){return n.enter("reference"),n.enter("referenceMarker"),n.consume(d),n.exit("referenceMarker"),s}function s(d){return d===93?(n.enter("referenceMarker"),n.consume(d),n.exit("referenceMarker"),n.exit("reference"),r):a(d)}}const e3={name:"labelStartImage",resolveAll:Wd.resolveAll,tokenize:t3};function t3(n,r,a){const u=this;let s;return d;function d(p){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(p),n.exit("labelImageMarker"),f}function f(p){return p===91?(n.enter("labelMarker"),n.consume(p),n.exit("labelMarker"),s=n.exit("labelImage"),m):a(p)}function m(p){return p===94&&"_hiddenFootnoteSupport"in u.parser.constructs?a(p):(u._labelStarts=u._labelStarts||[],u._labelStarts.push(s),r(p))}}const n3={name:"labelStartLink",resolveAll:Wd.resolveAll,tokenize:l3};function l3(n,r,a){const u=this;let s;return d;function d(m){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(m),n.exit("labelMarker"),s=n.exit("labelLink"),f}function f(m){return m===94&&"_hiddenFootnoteSupport"in u.parser.constructs?a(m):(u._labelStarts=u._labelStarts||[],u._labelStarts.push(s),r(m))}}const rd={name:"lineEnding",tokenize:i3};function i3(n,r){return a;function a(u){return n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),et(n,r,"linePrefix")}}const ts={name:"thematicBreak",tokenize:r3};function r3(n,r,a){let u=0,s;return d;function d(x){return n.enter("thematicBreak"),f(x)}function f(x){return s=x,m(x)}function m(x){return x===s?(n.enter("thematicBreakSequence"),p(x)):u>=3&&(x===null||Te(x))?(n.exit("thematicBreak"),r(x)):a(x)}function p(x){return x===s?(n.consume(x),u++,p):(n.exit("thematicBreakSequence"),Ve(x)?et(n,m,"whitespace")(x):m(x))}}const xn={continuation:{tokenize:s3},exit:f3,name:"list",tokenize:o3},a3={partial:!0,tokenize:d3},u3={partial:!0,tokenize:c3};function o3(n,r,a){const u=this,s=u.events[u.events.length-1];let d=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,f=0;return m;function m(v){const S=u.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!u.containerState.marker||v===u.containerState.marker:Td(v)){if(u.containerState.type||(u.containerState.type=S,n.enter(S,{_container:!0})),S==="listUnordered")return n.enter("listItemPrefix"),v===42||v===45?n.check(ts,a,x)(v):x(v);if(!u.interrupt||v===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),p(v)}return a(v)}function p(v){return Td(v)&&++f<10?(n.consume(v),p):(!u.interrupt||f<2)&&(u.containerState.marker?v===u.containerState.marker:v===41||v===46)?(n.exit("listItemValue"),x(v)):a(v)}function x(v){return n.enter("listItemMarker"),n.consume(v),n.exit("listItemMarker"),u.containerState.marker=u.containerState.marker||v,n.check(su,u.interrupt?a:y,n.attempt(a3,w,g))}function y(v){return u.containerState.initialBlankLine=!0,d++,w(v)}function g(v){return Ve(v)?(n.enter("listItemPrefixWhitespace"),n.consume(v),n.exit("listItemPrefixWhitespace"),w):a(v)}function w(v){return u.containerState.size=d+u.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(v)}}function s3(n,r,a){const u=this;return u.containerState._closeFlow=void 0,n.check(su,s,d);function s(m){return u.containerState.furtherBlankLines=u.containerState.furtherBlankLines||u.containerState.initialBlankLine,et(n,r,"listItemIndent",u.containerState.size+1)(m)}function d(m){return u.containerState.furtherBlankLines||!Ve(m)?(u.containerState.furtherBlankLines=void 0,u.containerState.initialBlankLine=void 0,f(m)):(u.containerState.furtherBlankLines=void 0,u.containerState.initialBlankLine=void 0,n.attempt(u3,r,f)(m))}function f(m){return u.containerState._closeFlow=!0,u.interrupt=void 0,et(n,n.attempt(xn,r,a),"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m)}}function c3(n,r,a){const u=this;return et(n,s,"listItemIndent",u.containerState.size+1);function s(d){const f=u.events[u.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===u.containerState.size?r(d):a(d)}}function f3(n){n.exit(this.containerState.type)}function d3(n,r,a){const u=this;return et(n,s,"listItemPrefixWhitespace",u.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(d){const f=u.events[u.events.length-1];return!Ve(d)&&f&&f[1].type==="listItemPrefixWhitespace"?r(d):a(d)}}const oy={name:"setextUnderline",resolveTo:h3,tokenize:m3};function h3(n,r){const a=new rs;let u=n.length,s,d,f;for(;u--;)if(n[u][0]==="enter"){if(n[u][1].type==="content"){s=u;break}n[u][1].type==="paragraph"&&(d=u)}else n[u][1].type==="content"&&a.add(u,1,[]),!f&&n[u][1].type==="definition"&&(f=u);const m={type:"setextHeading",start:{...n[s][1].start},end:{...n[n.length-1][1].end}};return n[d][1].type="setextHeadingText",f?(a.add(d,0,[["enter",m,r]]),a.add(f+1,0,[["exit",n[s][1],r]]),n[s][1].end={...n[f][1].end}):n[s][1]=m,a.add(n.length,0,[["exit",m,r]]),a.consume(n),n}function m3(n,r,a){const u=this;let s;return d;function d(x){let y=u.events.length,g;for(;y--;)if(u.events[y][1].type!=="lineEnding"&&u.events[y][1].type!=="linePrefix"&&u.events[y][1].type!=="content"){g=u.events[y][1].type==="paragraph";break}return!u.parser.lazy[u.now().line]&&(u.interrupt||g)?(n.enter("setextHeadingLine"),s=x,f(x)):a(x)}function f(x){return n.enter("setextHeadingLineSequence"),m(x)}function m(x){return x===s?(n.consume(x),m):(n.exit("setextHeadingLineSequence"),Ve(x)?et(n,p,"lineSuffix")(x):p(x))}function p(x){return x===null||Te(x)?(n.exit("setextHeadingLine"),r(x)):a(x)}}const p3={tokenize:g3};function g3(n){const r=this,a=n.attempt(su,u,n.attempt(this.parser.constructs.flowInitial,s,et(n,n.attempt(this.parser.constructs.flow,s,n.attempt(NN,s)),"linePrefix")));return a;function u(d){if(d===null){n.consume(d);return}return n.enter("lineEndingBlank"),n.consume(d),n.exit("lineEndingBlank"),r.currentConstruct=void 0,a}function s(d){if(d===null){n.consume(d);return}return n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),r.currentConstruct=void 0,a}}const x3={resolveAll:zb()},y3=Ab("string"),b3=Ab("text");function Ab(n){return{resolveAll:zb(n==="text"?v3:void 0),tokenize:r};function r(a){const u=this,s=this.parser.constructs[n],d=a.attempt(s,f,m);return f;function f(y){return x(y)?d(y):m(y)}function m(y){if(y===null){a.consume(y);return}return a.enter("data"),a.consume(y),p}function p(y){return x(y)?(a.exit("data"),d(y)):(a.consume(y),p)}function x(y){if(y===null)return!0;const g=s[y];let w=-1;if(g)for(;++w-1){const m=f[0];typeof m=="string"?f[0]=m.slice(u):f.shift()}d>0&&f.push(n[s].slice(0,d))}return f}function M3(n,r){let a=-1;const u=[];let s;for(;++a1}}function rk({directory:n}){const[r,a]=_.useState(0);_.useEffect(()=>{a(0);const d=window.setInterval(()=>{a(f=>f+1)},1e3);return()=>window.clearInterval(d)},[]);const{label:u,cut:s}=ik(n);return h.jsxs("div",{"data-testid":"scan-status-strip",className:"flex min-w-0 items-center gap-1.5 text-[11px] text-ink-muted",children:[h.jsx(Wi,{className:"h-3 w-3 shrink-0 animate-spin text-chip-indigo-text motion-reduce:animate-none","aria-hidden":"true"}),h.jsxs("span",{className:"min-w-0 truncate",children:["Scanning",n&&h.jsxs(h.Fragment,{children:[" ",h.jsxs("span",{className:"font-mono text-ink-secondary",title:n,children:[s?"…/":"",u]})]})," — ",h.jsx("span",{className:"font-mono tabular-nums text-ink-secondary",children:lk(r)})]})]})}function ak({onExecute:n,scanning:r,hasSelection:a,fileCount:u,totalCount:s,scanningDirectory:d="",toastMessage:f,onToastDismiss:m}){const p=(f==null?void 0:f.kind)==="error";return h.jsxs("div",{className:"relative flex items-center justify-between border-t border-line bg-surface-glass px-4 py-2.5 text-xs transition-colors duration-200",children:[f&&h.jsx("div",{role:"status","aria-live":p?"assertive":"polite","aria-atomic":"true",className:`animate-toast-in absolute left-1/2 top-1/2 z-[var(--z-toast)] max-w-[min(80vw,640px)] -translate-x-1/2 -translate-y-1/2 rounded-xl border px-4 py-2 text-xs font-medium glass-panel-strong ${p?"pointer-events-auto flex max-w-[min(70vw,560px)] items-center gap-2.5 border-status-danger-border text-left text-ink":"pointer-events-none max-w-[min(70vw,560px)] text-center text-ink"}`,children:p?h.jsxs(h.Fragment,{children:[h.jsx(bd,{className:"h-3.5 w-3.5 shrink-0 text-status-danger-text/80","aria-hidden":"true"}),h.jsx("span",{className:"min-w-0 flex-1",children:f.message}),m&&h.jsx("button",{type:"button",onClick:m,"aria-label":"Dismiss error",className:"shrink-0 rounded-md p-0.5 text-status-danger-text/60 hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-status-danger-border transition-colors",children:h.jsx(nl,{className:"h-3.5 w-3.5"})})]}):f.message}),h.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[r&&h.jsx(rk,{directory:d}),s!==void 0&&s!==u&&h.jsxs("span",{"data-testid":"action-bar-count",className:"text-ink-muted",children:["Showing ",u," of ",s]})]}),h.jsxs("button",{onClick:n,disabled:!a||r,className:"flex shrink-0 items-center gap-2 rounded-xl border border-emerald-300/50 bg-gradient-to-b from-emerald-400/90 to-emerald-600/90 px-5 py-2 font-semibold text-white shadow-[inset_0_1px_0_rgb(255_255_255/0.35),0_8px_24px_-6px_rgb(16_185_129/0.55)] transition-[filter,box-shadow,transform] hover:-translate-y-px hover:brightness-110 hover:shadow-[inset_0_1px_0_rgb(255_255_255/0.35),0_12px_30px_-6px_rgb(16_185_129/0.7)] disabled:opacity-40 disabled:hover:translate-y-0 disabled:hover:brightness-100 disabled:hover:shadow-[inset_0_1px_0_rgb(255_255_255/0.35),0_8px_24px_-6px_rgb(16_185_129/0.55)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400",children:[h.jsx(er,{className:"h-3.5 w-3.5 fill-current"}),h.jsx("span",{children:"Execute"}),h.jsx("kbd",{className:"rounded bg-emerald-800/60 px-1.5 py-0.5 text-[10px] text-emerald-200 shadow-[inset_0_1px_0_rgb(255_255_255/0.12)]",children:"↵"})]})]})}function uk({position:n,onClose:r,onLaunch:a,onLaunchWithArgs:u,onReveal:s,onOpenFolder:d,onOpenTerminal:f,onScanDirectory:m,onFilterFolder:p,onFilterExtension:x,onCopyPath:y,onCopyFilename:g,onCopyUri:w,onComputeHash:v,onVerifyHash:S,onProperties:T,onClearFile:L,onGenerateBarcode:D,showToast:$}){const[I,J]=_.useState(!1),[ie,U]=_.useState(""),R=_.useRef(null),Q=_.useRef(null),fe=_.useRef(null),[B,ne]=_.useState(null);if(_.useEffect(()=>{var re;I&&((re=Q.current)==null||re.showModal())},[I]),_.useLayoutEffect(()=>{if(!n){ne(null);return}const re=()=>{const N=R.current;if(!N)return;const qe=N.getBoundingClientRect(),Ge=8;ne({left:Math.max(Ge,Math.min(n.x,window.innerWidth-qe.width-Ge)),top:Math.max(Ge,Math.min(n.y,window.innerHeight-qe.height-Ge))})};return re(),window.addEventListener("resize",re),()=>window.removeEventListener("resize",re)},[n]),_.useEffect(()=>{if(!n)return;fe.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const re=window.requestAnimationFrame(()=>{var N,qe;(qe=(N=R.current)==null?void 0:N.querySelector("[role='menuitem']"))==null||qe.focus()});return()=>{var N;window.cancelAnimationFrame(re),(N=fe.current)==null||N.focus()}},[n]),!n)return null;const{file:V,x:se,y:ve}=n,ae=()=>{u(V,ie),J(!1),r()},A=re=>{const N=re.lastIndexOf(".");return N!==-1?re.slice(N):""},W=re=>{const N=Math.max(re.lastIndexOf("/"),re.lastIndexOf("\\"));return N!==-1?re.slice(0,N):re},le=re=>{const N=Math.max(re.lastIndexOf("/"),re.lastIndexOf("\\"));return N!==-1?re.slice(0,N):""};return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 z-[calc(var(--z-context-menu)-1)]",onClick:r,onContextMenu:re=>{re.preventDefault(),r()},"aria-hidden":"true"}),h.jsxs("div",{ref:R,role:"menu","aria-label":`Actions for ${V.filename}`,tabIndex:0,onKeyDown:re=>{var Ge,M,E,Y;["Escape","ArrowDown","ArrowUp","Home","End"].includes(re.key)&&re.stopPropagation();const N=Array.from(((Ge=R.current)==null?void 0:Ge.querySelectorAll("[role='menuitem']"))??[]),qe=N.indexOf(document.activeElement);if(re.key==="Escape")re.preventDefault(),r();else if(re.key==="ArrowDown"||re.key==="ArrowUp"){re.preventDefault();const oe=re.key==="ArrowDown"?1:-1;(M=N[(qe+oe+N.length)%N.length])==null||M.focus()}else re.key==="Home"?(re.preventDefault(),(E=N[0])==null||E.focus()):re.key==="End"&&(re.preventDefault(),(Y=N.at(-1))==null||Y.focus())},className:"animate-modal-in fixed z-[var(--z-context-menu)] max-h-[calc(100dvh-16px)] w-56 max-w-[calc(100vw-16px)] overflow-y-auto rounded-lg border border-line bg-surface-glass py-1 text-xs text-ink shadow-2xl backdrop-blur-md",style:B??{left:se,top:ve,visibility:"hidden"},children:[h.jsx("div",{className:"border-b border-line px-3 py-2 font-medium text-ink-muted truncate",children:V.filename}),h.jsxs("button",{role:"menuitem",onClick:()=>{a(V),r()},className:"flex w-full items-center gap-2 px-3 py-3 min-h-[44px] hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Launch ${V.filename}`,children:[h.jsx(er,{className:"h-3.5 w-3.5 fill-current text-status-success-text group-hover:text-white"}),h.jsx("span",{children:"Launch"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{J(!0)},className:"flex w-full items-center gap-2 px-3 py-3 min-h-[44px] hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Launch ${V.filename} with arguments`,children:[h.jsx(er,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Launch with arguments..."})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{s(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Reveal ${V.filename} in file manager`,children:[h.jsx(vd,{className:"h-3.5 w-3.5 text-chip-sky-text group-hover:text-white"}),h.jsx("span",{children:"Reveal in File Manager"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{d(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Open folder containing ${V.filename}`,children:[h.jsx(Ji,{className:"h-3.5 w-3.5 text-chip-amber-text group-hover:text-white"}),h.jsx("span",{children:"Open Folder"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{f(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Open terminal in directory containing ${V.filename}`,children:[h.jsx(kd,{className:"h-3.5 w-3.5 text-status-success-text group-hover:text-white"}),h.jsx("span",{children:"Open Terminal in Directory"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{D(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":"Generate QR Code",children:[h.jsx(Gd,{className:"h-3.5 w-3.5 text-chip-fuchsia-text group-hover:text-white"}),h.jsx("span",{children:"Generate QR Code"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{const re=W(V.path);m(re),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":"Scan to Directory",children:[h.jsx(Ji,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Scan to Directory"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{const re=le(V.rel_path);re&&p(re),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Filter view to folder ${V.filename} is in`,children:[h.jsx(wd,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Filter to Folder"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{const re=A(V.filename);re&&x(re),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Filter view by extension ${A(V.filename)}`,children:[h.jsx(wd,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Filter by Extension"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{y(V,!1),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy full path of ${V.filename}`,children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Full Path"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{y(V,!0),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy path of ${V.filename} with forward slashes`,children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Path (Forward Slashes)"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{g(V,!1),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy filename of ${V.filename}`,children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Filename"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{g(V,!0),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy filename of ${V.filename} without extension`,children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Filename (no ext)"})]}),h.jsxs("button",{role:"menuitem",onClick:async()=>{const re=W(V.path);r();try{await navigator.clipboard.writeText(re),$==null||$(`Copied: ${re}`)}catch(N){$==null||$(`Copy failed: ${(N==null?void 0:N.message)??N}`,"error")}},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":"Copy Directory",children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Directory"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{w(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy URI of ${V.filename}`,children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy URI"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{v(V,"md5"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Compute MD5 hash of ${V.filename}`,children:[h.jsx(Zr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Compute MD5 Hash"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{v(V,"sha256"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Compute SHA256 hash of ${V.filename}`,children:[h.jsx(Zr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Compute SHA256 Hash"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{S(V,"md5"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Verify MD5 hash of ${V.filename}`,children:[h.jsx(Zr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Verify MD5 Hash"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{S(V,"sha256"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Verify SHA256 hash of ${V.filename}`,children:[h.jsx(Zr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Verify SHA256 Hash"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{T(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`View properties of ${V.filename}`,children:[h.jsx(vd,{className:"h-3.5 w-3.5 text-chip-sky-text group-hover:text-white"}),h.jsx("span",{children:"Properties"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{L(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Remove ${V.filename} from list`,children:[h.jsx(Py,{className:"h-3.5 w-3.5 text-status-danger-text group-hover:text-white"}),h.jsx("span",{children:"Delete"})]})]}),I&&h.jsx("dialog",{ref:Q,className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 rounded-xl","aria-labelledby":"args-modal-title",onClick:re=>{re.target===Q.current&&J(!1)},onCancel:re=>{re.preventDefault(),J(!1)},children:h.jsxs("div",{className:"animate-modal-in w-96 rounded-xl border border-frame-line glass-panel p-4",children:[h.jsx("h3",{id:"args-modal-title",className:"mb-2 text-sm font-semibold text-ink",children:"Launch with Arguments"}),h.jsx("p",{className:"mb-3 text-xs text-ink-muted truncate",children:V.filename}),h.jsx("input",{type:"text",autoFocus:!0,placeholder:"Arguments (e.g. --verbose --port 80)",value:ie,onChange:re=>U(re.target.value),onKeyDown:re=>{re.key==="Enter"&&ae(),re.key==="Escape"&&J(!1)},className:"mb-4 w-full rounded-md border border-line bg-elevated px-3 py-2 text-xs text-ink outline-none focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500","aria-label":"Command line arguments"}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx("button",{onClick:()=>J(!1),className:"rounded-md px-3 py-1.5 text-xs text-ink-muted hover:bg-elevated hover:text-ink focus:outline-none focus:ring-2 focus:ring-indigo-500","aria-label":"Cancel launch",children:"Cancel"}),h.jsx("button",{onClick:ae,className:"btn btn-primary px-3 py-1.5","aria-label":`Launch ${V.filename} with arguments`,children:"Launch"})]})]})})]})}var ok=Vy();const bl=8,bi=8,sk=400,Ox={top:"bottom",bottom:"top",left:"right",right:"left"},ck={top:"-bottom-1 left-1/2 -translate-x-1/2",bottom:"-top-1 left-1/2 -translate-x-1/2",left:"-right-1 top-1/2 -translate-y-1/2",right:"-left-1 top-1/2 -translate-y-1/2"},fk={top:"border-b border-r",bottom:"border-t border-l",left:"border-t border-r",right:"border-b border-l"},Rx=(n,r,a)=>{switch(n){case"top":return r.top-bi-a.h>=bl;case"bottom":return r.bottom+bi+a.h<=window.innerHeight-bl;case"left":return r.left-bi-a.w>=bl;default:return r.right+bi+a.w<=window.innerWidth-bl}},dk=(n,r,a)=>{if(n==="top"||n==="bottom"){const f=r.left+r.width/2-a.w/2,m=window.innerWidth-a.w-bl;return{x:Math.min(Math.max(f,bl),Math.max(bl,m))-f,y:0}}const u=r.top+r.height/2-a.h/2,s=window.innerHeight-a.h-bl;return{x:0,y:Math.min(Math.max(u,bl),Math.max(bl,s))-u}},He=({text:n,children:r,block:a=!0,placement:u="top",suppress:s=!1})=>{const d=_.useRef(null),f=_.useRef(null),m=_.useId(),p=_.useRef(null),[x,y]=_.useState(!1),[g,w]=_.useState(u),[v,S]=_.useState({x:0,y:0}),[T,L]=_.useState({left:-9999,top:-9999}),D=()=>{p.current!==null&&(window.clearTimeout(p.current),p.current=null)};_.useEffect(()=>{s&&(D(),y(!1))},[s]),_.useEffect(()=>()=>D(),[]);const $=_.useCallback(()=>{const U=d.current,R=f.current;if(!U||!R)return;const Q=U.getBoundingClientRect(),fe={w:R.offsetWidth,h:R.offsetHeight},B=Rx(u,Q,fe)?u:Rx(Ox[u],Q,fe)?Ox[u]:u,ne=dk(B,Q,fe);w(B),S(ne);const V=Q.left+Q.width/2,se=Q.top+Q.height/2;L(B==="top"?{left:V,top:Q.top-bi-fe.h}:B==="bottom"?{left:V,top:Q.bottom+bi}:B==="left"?{left:Q.left-bi-fe.w,top:se}:{left:Q.right+bi,top:se})},[u]);_.useEffect(()=>{if(!x)return;const U=()=>y(!1);return window.addEventListener("resize",U),window.addEventListener("scroll",U,!0),()=>{window.removeEventListener("resize",U),window.removeEventListener("scroll",U,!0)}},[x]);const I=U=>{if(s)return;D();const R=()=>{$(),y(!0)};U?R():p.current=window.setTimeout(R,sk)},J=()=>{D(),y(!1)};_.useEffect(()=>{if(!x)return;const U=R=>{R.key==="Escape"&&y(!1)};return document.addEventListener("keydown",U,!0),()=>document.removeEventListener("keydown",U,!0)},[x]),_.useEffect(()=>{if(!x)return;const U=()=>!!document.querySelector('[role="dialog"][aria-modal="true"], dialog[open]');if(U()){y(!1);return}const R=new MutationObserver(()=>{U()&&y(!1)});return R.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["role","aria-modal","open","class"]}),()=>R.disconnect()},[x]);const ie={onMouseEnter:()=>I(!1),onMouseLeave:J,onFocus:()=>I(!0),onBlur:J,"aria-describedby":m};return h.jsxs("div",{ref:d,className:`group relative ${a?"flex min-w-0 flex-1 items-center":"inline-flex shrink-0 items-center"}`,onMouseEnter:()=>I(!1),onMouseLeave:J,onFocus:()=>I(!0),onBlur:J,children:[_.cloneElement(r,ie),ok.createPortal(h.jsxs("span",{ref:f,id:m,role:"tooltip",className:`pointer-events-none invisible fixed z-[var(--z-tooltip)] w-max max-w-[calc(100vw-16px)] rounded-md border border-line bg-elevated px-2 py-1 text-left text-[11px] leading-relaxed text-ink shadow-lg ${x?"visible opacity-100":"opacity-0"}`,style:{left:T.left,top:T.top,transform:g==="top"||g==="bottom"?`translateX(calc(-50% + ${v.x}px))`:`translateY(calc(-50% + ${v.y}px))`},children:[n,h.jsx("span",{className:`absolute h-2 w-2 rotate-45 border-line bg-elevated ${ck[g]} ${fk[g]}`,style:g==="top"||g==="bottom"?{left:`calc(50% - ${v.x}px)`}:void 0})]}),document.body)]})};function hk({isOpen:n,initialPath:r,onClose:a,onSelect:u}){const[s,d]=_.useState(null),[f,m]=_.useState(null),[p,x]=_.useState(""),[y,g]=_.useState(!1),[w,v]=_.useState(null),S=_.useRef(null),T=_.useRef(null),L=_.useRef(null);_.useEffect(()=>{var ie;if(!n){(ie=L.current)==null||ie.focus();return}L.current=document.activeElement instanceof HTMLElement?document.activeElement:null,v(null),D(r||"");const J=requestAnimationFrame(()=>{var U;return(U=T.current)==null?void 0:U.focus()});return()=>{var U;cancelAnimationFrame(J),(U=L.current)==null||U.focus()}},[n]);const D=async J=>{g(!0),v(null);try{const ie=await fetch(`/api/fs/browse?path=${encodeURIComponent(J)}`);if(!ie.ok)throw new Error("Failed to browse directory");const U=await ie.json();d(U),m(U.current_path),x(U.current_path)}catch(ie){v(ie.message||"Navigation failed")}finally{g(!1)}},$=()=>{const J=p.trim()||f;J&&(u(J),a())},I=J=>{var Q;if(J.key==="Escape"){J.preventDefault(),a();return}if(J.key!=="Tab")return;const ie=(Q=S.current)==null?void 0:Q.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(!(ie!=null&&ie.length))return;const U=ie[0],R=ie[ie.length-1];J.shiftKey&&document.activeElement===U?(J.preventDefault(),R.focus()):!J.shiftKey&&document.activeElement===R&&(J.preventDefault(),U.focus())};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/65 p-3 backdrop-blur-sm sm:p-6",onClick:a,children:h.jsxs("div",{ref:S,role:"dialog","aria-modal":"true","aria-labelledby":"directory-picker-title",onKeyDown:I,className:"animate-modal-in flex h-[min(84dvh,760px)] max-h-[calc(100dvh-1.5rem)] w-[min(94vw,960px)] min-h-0 flex-col overflow-hidden rounded-xl border border-frame-line glass-panel sm:rounded-2xl",onClick:J=>J.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-line px-4 py-3 sm:px-5",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Ji,{className:"h-5 w-5 text-chip-indigo-text"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{id:"directory-picker-title",className:"text-sm font-semibold text-ink",children:"Select a directory"}),h.jsx("p",{className:"truncate font-mono text-xs text-ink-muted",children:(s==null?void 0:s.current_path)||""})]})]}),h.jsx(He,{text:"Close",block:!1,children:h.jsx("button",{type:"button",onClick:a,"aria-label":"Close directory picker",className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg text-ink-muted transition-colors hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(nl,{className:"h-4 w-4"})})})]}),h.jsxs("div",{className:"border-b border-line px-4 py-3 sm:px-5",children:[h.jsx("label",{htmlFor:"directory-picker-path",className:"mb-1.5 block text-xs font-medium text-ink-secondary",children:"Location"}),h.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[h.jsx("input",{ref:T,id:"directory-picker-path",type:"text",value:p,onChange:J=>x(J.target.value),onKeyDown:J=>{J.key==="Enter"&&D(p.trim())},placeholder:"/path/to/directory",className:"h-10 min-w-0 flex-1 rounded-lg border border-line bg-elevated px-2.5 font-mono text-sm text-ink outline-none placeholder:text-ink-faint transition-colors hover:bg-surface-strong focus-visible:border-indigo-500 focus-visible:ring-2 focus-visible:ring-indigo-500/30"}),h.jsx("button",{type:"button",onClick:()=>D(p.trim()),className:"inline-flex h-10 shrink-0 items-center gap-1.5 rounded-lg border border-line bg-elevated px-3.5 text-sm font-medium text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Go"}),h.jsx(He,{text:"Home directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>D(""),"aria-label":"Home directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Yd,{className:"h-4 w-4"})})}),(s==null?void 0:s.parent_path)&&h.jsx(He,{text:"Parent directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>D(s.parent_path),"aria-label":"Parent directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Vd,{className:"h-4 w-4 rotate-180"})})})]})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 py-2 sm:px-3 sm:py-3","aria-busy":y,children:y?h.jsxs("div",{className:"flex h-full items-center justify-center gap-2.5 text-sm text-ink-muted",children:[h.jsx(Wi,{className:"h-5 w-5 animate-spin text-chip-indigo-text"}),h.jsx("span",{role:"status",children:"Loading directories…"})]}):w?h.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-2.5 text-center",children:[h.jsx("p",{className:"text-sm text-status-danger-text",children:w}),h.jsx("button",{type:"button",onClick:()=>D(p||(s==null?void 0:s.current_path)||""),className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Retry"})]}):h.jsxs("ul",{className:"space-y-0.5",children:[s==null?void 0:s.items.filter(J=>J.is_dir).map(J=>h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>D(J.path),onDoubleClick:()=>{x(J.path),u(J.path),a()},className:`flex min-h-10 w-full items-center justify-between rounded-lg px-3 py-1.5 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-400 ${f===J.path?"bg-chip-indigo-bg text-chip-indigo-text":"text-ink-secondary hover:bg-elevated hover:text-ink"}`,children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx(ss,{className:"h-5 w-5 shrink-0 text-chip-indigo-text"}),h.jsx("span",{className:"truncate",children:J.name})]}),f===J.path&&h.jsx(vi,{className:"h-4 w-4 shrink-0 text-chip-indigo-text"})]})},J.path)),(s==null?void 0:s.items.filter(J=>J.is_dir).length)===0&&h.jsxs("li",{className:"flex h-full min-h-36 flex-col items-center justify-center gap-2.5 text-center text-sm text-ink-muted",children:[h.jsx(Ji,{className:"h-7 w-7 text-ink-faint"}),"No subdirectories found"]})]})}),h.jsxs("div",{className:"flex flex-col gap-2 border-t border-line px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"mb-0.5 text-xs font-medium text-ink-muted",children:"Selected folder"}),h.jsx("p",{className:"truncate font-mono text-sm text-ink",title:f||p,children:f||p||"—"})]}),h.jsxs("div",{className:"flex shrink-0 justify-end gap-1.5",children:[h.jsx("button",{type:"button",onClick:a,className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Cancel"}),h.jsxs("button",{type:"button",onClick:$,disabled:!p.trim(),className:"btn btn-primary min-h-10 rounded-lg px-4 text-sm font-semibold",children:[h.jsx(Ji,{className:"h-4 w-4"}),"Select folder"]})]})]})]})}):null}function mk({visible:n,onFileSelected:r}){const a=_.useRef(null);return n?h.jsxs("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-drop-overlay)] flex items-center justify-center bg-black/65 backdrop-blur-sm",onClick:()=>{var u;return(u=a.current)==null?void 0:u.click()},"data-testid":"drop-config-overlay",children:[h.jsx("input",{ref:a,type:"file",accept:".profiles,.profiles.yaml,.profiles.yml,.yaml,.yml",className:"hidden",onChange:u=>{var d;const s=(d=u.target.files)==null?void 0:d[0];s&&r(s),u.target.value=""}}),h.jsxs("div",{className:"rounded-xl border-2 border-dashed border-chip-indigo-border bg-surface px-8 py-6 text-center shadow-2xl",children:[h.jsx("span",{className:"mx-auto mb-3 grid h-9 w-9 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Kr,{className:"h-5 w-5 text-chip-indigo-text"})}),h.jsx("p",{className:"text-sm font-semibold text-ink",children:"Drop configuration file"}),h.jsx("p",{className:"mt-1 text-xs text-ink-muted",children:".profiles, .profiles.yaml, .yml, .yaml — session-only preview"})]})]}):null}function pk({items:n,columnTemplate:r,resizePointerRef:a,resizeMovedRef:u}){return h.jsx("div",{className:"grid select-none items-center border-b border-l-2 border-l-transparent border-line/40 bg-surface/60 font-medium text-ink-muted shadow-sm backdrop-blur-md",role:"row","aria-rowindex":1,"data-file-list-header":!0,style:{gridTemplateColumns:r},children:n.map((s,d)=>{const f=!!(s.onSort&&s.sortKey),m=s.active?s.direction==="asc"?"ascending":"descending":"none";return h.jsxs("div",{role:"columnheader","data-column-key":s.sortKey,className:`group relative flex items-center gap-1.5 truncate px-3 py-2 ${f?"cursor-pointer hover:text-ink transition-colors":""} ${s.active?"text-ink":""}`,...f?{"aria-sort":m,tabIndex:0,onClick:s.onSort,onKeyDown:p=>{var x;(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),(x=s.onSort)==null||x.call(s))}}:{},children:[s.icon,h.jsx("span",{className:"truncate",children:s.label}),f?s.active?s.direction==="asc"?h.jsx(q2,{className:"ml-auto h-3 w-3 shrink-0 text-chip-indigo-text"}):h.jsx(Qy,{className:"ml-auto h-3 w-3 shrink-0 text-chip-indigo-text"}):h.jsx(Dx,{className:"ml-auto h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-40 hover:opacity-40"}):d>0&&h.jsx(Dx,{className:"ml-auto h-3 w-3 shrink-0 opacity-40"}),s.canResize&&s.onResizeBy&&h.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize ${s.label} column`,"aria-valuemin":$r,"aria-valuemax":ls,"aria-valuenow":s.width??s.defaultWidth??es,"aria-valuetext":`${s.width??s.defaultWidth??es} pixels wide`,title:"Drag to resize; use arrow keys or click either side to adjust",tabIndex:0,onClick:p=>{var g;p.preventDefault(),p.stopPropagation();const x=u.current;if(u.current=!1,x)return;const y=p.currentTarget.getBoundingClientRect();(g=s.onResizeBy)==null||g.call(s,p.clientX{p.preventDefault(),p.stopPropagation();const x=p.currentTarget.parentElement;u.current=!1,a.current={pointerId:p.pointerId,startX:p.clientX,startWidth:s.width??(x==null?void 0:x.getBoundingClientRect().width)??s.defaultWidth??es,resizeTo:s.onResizeTo},p.currentTarget.setPointerCapture(p.pointerId)},onPointerMove:p=>{const x=a.current;if(!x||x.pointerId!==p.pointerId)return;const y=p.clientX-x.startX;Math.abs(y)>2&&(u.current=!0),x.resizeTo(x.startWidth+y)},onPointerUp:p=>{var x;((x=a.current)==null?void 0:x.pointerId)===p.pointerId&&(p.currentTarget.releasePointerCapture(p.pointerId),a.current=null,window.setTimeout(()=>{u.current=!1},0))},onPointerCancel:()=>{a.current=null,u.current=!1},onKeyDown:p=>{var x,y;p.stopPropagation(),p.key==="ArrowLeft"||p.key==="ArrowRight"?(p.preventDefault(),(x=s.onResizeBy)==null||x.call(s,p.key==="ArrowLeft"?-Yo:Yo)):(p.key==="Home"||p.key==="End")&&(p.preventDefault(),(y=s.onResizeTo)==null||y.call(s,p.key==="Home"?$r:ls))},className:"absolute inset-y-0 right-0 z-10 w-3 cursor-col-resize touch-none border-r border-transparent transition-colors hover:border-indigo-400 focus-visible:border-indigo-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500"})]},d)})})}const Wn=28,Vo=12,ed=500,$r=80,ls=960,es=160,Yo=24,Lx=44,Go={File:2,Path:3,FileName:1,Type:1,Version:1};function gk({files:n,totalCount:r,rawLoadedCount:a,onLoadMore:u,loadingMore:s=!1,scanning:d=!1,hasScanned:f=!1,activeDirectory:m="",recursive:p=!1,onDisableRecursive:x,onOpenDirectory:y,onOpenConfig:g,filterText:w,onClearFilter:v,prefilterNote:S,columnHeaders:T,columnNames:L,selectedIndex:D,onSelectIndex:$,onLaunch:I,onContextMenu:J,rowColors:ie,sort:U,onSortChange:R}){const Q=["File"],fe=L.length>0?L:Q,B=T.length>0?T:fe,ne=Array.from({length:Math.max(fe.length,B.length)},(ge,Me)=>({key:fe[Me]??Q[0],header:B[Me]??fe[Me]??Q[0]})),V=_.useRef(null),[se,ve]=_.useState(0),[ae,A]=_.useState(600),[W,le]=_.useState(0),[re,N]=_.useState({}),qe=_.useRef(null),Ge=_.useRef(!1),M=fe.reduce((ge,Me)=>ge+(Go[Me]??1),1),E=(ge,Me)=>{const Le=Math.min(ls,Math.max($r,Math.round(Me)));N(lt=>({...lt,[ge]:Le}))},Y=(ge,Me)=>{var K;const Le=Array.from(((K=V.current)==null?void 0:K.querySelectorAll("[data-column-key]"))??[]).find(ue=>ue.dataset.columnKey===ge),lt=re[ge]??(Le==null?void 0:Le.getBoundingClientRect().width)??es;E(ge,lt+Me)},oe=[`${Lx}px`,...fe.map(ge=>re[ge]?`${re[ge]}px`:`minmax(${$r}px, ${Go[ge]??1}fr)`)].join(" "),de=_.useRef(!1),je=_.useRef(null),ye=n.length,_e=a??ye,pe=r??_e,Se=_e{const ge=V.current;if(!ge)return;const Me=new ResizeObserver(Le=>{for(const lt of Le)A(lt.contentRect.height),le(lt.contentRect.width)});return Me.observe(ge),A(ge.clientHeight||600),le(ge.clientWidth||0),()=>Me.disconnect()},[]),_.useEffect(()=>{var ue;const ge=V.current;if(!ge||D<0||D>=ye)return;const Me=((ue=ge.querySelector("[data-file-list-header]"))==null?void 0:ue.offsetHeight)??0,Le=Me+D*Wn,lt=Le+Wn;let K=ge.scrollTop;Lege.scrollTop+ge.clientHeight&&(K=lt-ge.clientHeight),K!==ge.scrollTop&&(ge.scrollTop=K,ve(K))},[D,ye]),_.useEffect(()=>{const ge=V.current;if(!ge)return;const Me=()=>{if(de.current||!Bt||!u)return;const Le=ge.scrollTop+ge.clientHeight,lt=ye*Wn;lt-LeLe&&(de.current=!0,window.setTimeout(()=>{de.current=!1},200),u())};return ge.addEventListener("scroll",Me,{passive:!0}),window.addEventListener("scroll",Me,{passive:!0}),()=>{ge.removeEventListener("scroll",Me),window.removeEventListener("scroll",Me)}},[n,Bt,u,ye]),_.useEffect(()=>{if(de.current||!Bt||!u)return;const ge=ye*Wn,Me=se+ae;if(!(ge-MeMe))return;const lt=`${ye}:${_e}:${pe}`;je.current=lt,u()});const Gt=_.useCallback(ge=>{ve(ge.currentTarget.scrollTop)},[]),St=Math.max(0,Math.floor(se/Wn)-Vo),nt=Math.ceil(ae/Wn)+Vo*2,Je=Math.min(ye,St+nt),en=St*Wn,bn=(ge,Me)=>{if(Me)return{className:"bg-chip-indigo-bg border-l-4 border-chip-indigo-border text-ink",style:{}};for(const[Le,lt]of ie)if(ge.toLowerCase().includes(Le.toLowerCase()))return{className:"hover:bg-elevated border-l-4 text-ink",style:{borderLeftColor:lt,borderLeftWidth:"4px"}};return{className:"border-l-4 border-transparent text-ink-secondary hover:bg-elevated/60",style:{borderLeftColor:"transparent",borderLeftWidth:"4px"}}},tn=(Bt?ye+nt:ye)*Wn,Ht="btn btn-secondary px-3 py-1.5";return h.jsxs("div",{ref:V,onScroll:Gt,className:"flex-1 overflow-auto bg-app text-xs transition-colors duration-200 focus-visible:outline focus-visible:outline-2 focus-visible:outline-indigo-500 focus-visible:outline-offset-[-2px]","data-testid":"file-list","data-loaded-count":_e,"aria-busy":d,role:"grid","aria-label":"Discovered files","aria-rowcount":Math.max(pe,ye===0?1:0)+1,"aria-colcount":fe.length+1,"aria-activedescendant":ye>0?`file-row-${D}`:void 0,tabIndex:0,children:[h.jsx("div",{className:"sticky top-0 z-10",role:"presentation",children:h.jsx(pk,{columnTemplate:oe,resizePointerRef:qe,resizeMovedRef:Ge,items:[{label:"#",icon:h.jsx(wd,{className:"h-3.5 w-3.5"})},...ne.map(({key:ge,header:Me})=>({label:Me,weight:Go[ge]??1,width:re[ge],defaultWidth:Math.min(ls,Math.max($r,Math.round((W-Lx)*(Go[ge]??1)/M))),canResize:!0,onResizeBy:Le=>Y(ge,Le),onResizeTo:Le=>E(ge,Le),sortKey:ge,active:(U==null?void 0:U.column)===ge,direction:U==null?void 0:U.direction,onSort:()=>{(U==null?void 0:U.column)!==ge?R({column:ge,direction:"asc"}):U.direction==="asc"?R({column:ge,direction:"desc"}):R(null)}}))]})}),S&&ye>0&&h.jsxs("div",{role:"note","data-testid":"prefilter-note",className:"flex items-center gap-1.5 border-b border-line/40 bg-surface px-3 py-1 text-[11px] text-ink-faint",children:[h.jsx(Ky,{className:"h-3 w-3 shrink-0 text-ink-faint","aria-hidden":"true"}),h.jsx("span",{className:"min-w-0 truncate",children:S})]}),ye===0?h.jsx("div",{role:"row","aria-rowindex":2,"data-testid":"file-list-empty",children:h.jsx("div",{role:"gridcell","aria-colspan":fe.length+1,className:"p-8 text-center text-ink-faint",children:d?h.jsxs("div",{className:"flex flex-col items-center gap-2",children:[h.jsx(Wi,{className:"h-5 w-5 animate-spin text-chip-indigo-text motion-reduce:animate-none"}),h.jsx("span",{children:"Scanning files..."})]}):!m.trim()&&g?h.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h.jsx("span",{children:"Select a directory first."}),h.jsx("button",{type:"button",onClick:g,className:Ht,children:"Choose configuration"})]}):f?w.trim()?h.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h.jsxs("span",{children:["No files match “",w,"”."]}),h.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[h.jsx("button",{type:"button",onClick:v,className:Ht,children:"Clear filter"}),p&&x&&h.jsx("button",{type:"button",onClick:x,className:Ht,children:"Turn off recursive"}),y&&h.jsx("button",{type:"button",onClick:y,className:Ht,children:"Open directory"})]})]}):h.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h.jsx("span",{children:"No files found for the current directory and extension."}),h.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[p&&x&&h.jsx("button",{type:"button",onClick:x,className:Ht,children:"Turn off recursive"}),y&&h.jsx("button",{type:"button",onClick:y,className:Ht,children:"Open directory"})]})]}):h.jsx("span",{children:"Select a directory and scan to find files."})})}):h.jsxs("div",{className:"relative",style:{height:tn},role:"rowgroup",children:[s&&h.jsx("div",{className:"pointer-events-none absolute left-1/2 top-2 z-20 -translate-x-1/2","aria-hidden":"true",children:h.jsx(Wi,{className:"h-4 w-4 animate-spin text-chip-indigo-text"})}),h.jsx("div",{style:{transform:`translateY(${en}px)`},"data-testid":"file-list-window",role:"presentation",children:n.slice(St,Je).map((ge,Me)=>{const Le=St+Me,lt=Le===D,K=bn(ge.filename,lt);return h.jsxs("div",{id:`file-row-${Le}`,"data-row-index":Le,role:"row","aria-rowindex":Le+2,"aria-selected":lt,onClick:()=>{var ue;$(Le),(ue=V.current)==null||ue.focus()},onDoubleClick:()=>I(ge),onContextMenu:ue=>J(ue,ge,Le),className:`grid cursor-pointer items-center transition-colors ${K.className}`,style:{...K.style,height:Wn,gridTemplateColumns:oe},children:[h.jsxs("div",{className:"flex items-center justify-end gap-1 px-3 font-mono text-ink-faint",children:[ge.has_hook&&h.jsx("span",{title:ge.hook_pattern?`Launch workflow: ${ge.hook_pattern}`:"Launch workflow configured","aria-label":"Workflow hook attached",className:"inline-flex items-center text-status-warning-text hover:brightness-95",children:h.jsx(eb,{className:"h-3 w-3 shrink-0"})}),h.jsx("span",{className:"hidden sm:inline",children:Le+1})]}),fe.map((ue,ke)=>{const Ce=ge.column_values[ue]||(ue==="File"?ge.filename:"-");return h.jsx("div",{role:"gridcell","data-column-key":ue,className:"truncate px-3 font-mono",style:{minWidth:$r},title:ue==="Path"?ge.path:Ce,children:Ce},ke)})]},ge.path||Le)})}),Se&&h.jsxs("div",{className:"pointer-events-none absolute bottom-2 left-1/2 -translate-x-1/2 rounded-full border border-line bg-surface-strong px-3 py-1 text-[11px] text-ink-muted shadow","data-testid":"file-list-paging",children:[s?h.jsx(R2,{className:"mr-1.5 h-4 w-4 animate-spin motion-reduce:animate-none text-ink-muted"}):null,"(",_e," of ",pe," loaded)"]})]})]})}function Sd({id:n,ariaLabel:r,value:a,options:u,onChange:s,placeholder:d,className:f="",inputClassName:m="",optionLabel:p=y=>y,onOpenChange:x}){const y=_.useId(),g=_.useRef(null),[w,v]=_.useState(!1),[S,T]=_.useState(""),[L,D]=_.useState(-1),$=u.filter(R=>p(R).toLocaleLowerCase().includes(S.toLocaleLowerCase())),I=L>=0&&$[L]?`${y}-option-${L}`:void 0;_.useEffect(()=>{const R=Q=>{var fe;(fe=g.current)!=null&&fe.contains(Q.target)||v(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]),_.useEffect(()=>{x==null||x(w)},[w,x]),_.useEffect(()=>{var R;L<0||(R=document.getElementById(`${y}-option-${L}`))==null||R.scrollIntoView({block:"nearest"})},[L,y]);const J=()=>{T(""),D(-1),v(!0)},ie=R=>{s(R),T(""),D(-1),v(!1)},U=R=>{if(R.key==="ArrowDown"){if(R.preventDefault(),!w){J(),D(0);return}D(Q=>Math.min(Q+1,$.length-1))}else if(R.key==="ArrowUp"){if(R.preventDefault(),!w){J(),D($.length-1);return}D(Q=>Q<=0?$.length-1:Q-1)}else R.key==="Enter"&&w&&$[L]!==void 0?(R.preventDefault(),ie($[L])):R.key==="Escape"&&v(!1)};return h.jsxs("div",{ref:g,onBlur:R=>{var Q;(Q=g.current)!=null&&Q.contains(R.relatedTarget)||v(!1)},className:`relative flex min-w-0 ${f}`,children:[h.jsx("input",{id:n,type:"text",role:"combobox","aria-label":r,"aria-autocomplete":"list","aria-expanded":w,"aria-controls":y,"aria-activedescendant":I,value:a,placeholder:d,onChange:R=>{s(R.target.value),T(R.target.value),D(-1),v(!0)},onKeyDown:U,className:`min-w-0 flex-1 rounded-l-md border border-line bg-elevated px-3 py-1.5 text-ink outline-none transition-colors hover:bg-surface-strong focus:border-indigo-500 ${m}`}),h.jsx("button",{type:"button","aria-label":`Show ${r.toLowerCase()} options`,"aria-expanded":w,title:`Show ${r.toLowerCase()} options`,onMouseDown:R=>R.preventDefault(),onClick:()=>w?v(!1):J(),className:"shrink-0 rounded-r-md border border-l-0 border-line bg-elevated px-2 text-ink-muted hover:bg-surface-strong hover:text-ink focus-visible:z-10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-indigo-500 transition-colors",children:h.jsx(K2,{className:`h-3.5 w-3.5 transition-transform ${w?"rotate-180":""}`})}),w&&h.jsx("ul",{id:y,role:"listbox","aria-label":`${r} options`,className:"absolute left-0 top-full z-[var(--z-combobox-list)] mt-1 max-h-60 w-full min-w-48 overflow-y-auto rounded-md border border-line bg-surface py-1 text-ink shadow-xl",children:$.length>0?$.map((R,Q)=>{const fe=p(R),B=Q===L,ne=R===a;return h.jsx("li",{id:`${y}-option-${Q}`,role:"option","aria-selected":ne,title:fe||void 0,onMouseEnter:()=>D(Q),onMouseDown:V=>V.preventDefault(),onClick:()=>ie(R),className:`cursor-pointer truncate px-3 py-1.5 ${B?"bg-elevated text-ink":"text-ink-secondary"} ${ne?"font-semibold":""}`,children:fe||"(No filter)"},`${R}-${Q}`)}):h.jsx("li",{className:"px-3 py-1.5 text-ink-muted",children:"No matching presets"})})]})}function xk({title:n,release:r,directories:a,activeDirectory:u,onDirectoryChange:s,onBrowseDirectory:d,onGoToParentDirectory:f,onGoToHomeDirectory:m,onOpenActiveDirectory:p,onOpenTerminal:x}){const[y,g]=_.useState(!1);return h.jsxs("header",{className:"relative z-30 flex flex-wrap items-center gap-3 border-b border-line bg-app/90 px-5 py-2 text-xs backdrop-blur-xl shadow-xs transition-all duration-200",children:[h.jsx("div",{className:"flex shrink-0 items-center gap-3",children:h.jsxs("div",{className:"flex items-center gap-3.5",children:[h.jsxs("div",{className:"relative flex h-9 w-9 items-center justify-center rounded-xl bg-gradient-to-br from-chip-indigo-bg to-chip-purple-bg text-chip-indigo-text border border-chip-indigo-border shadow-xs",children:[h.jsx(kd,{className:"h-4 w-4"}),h.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 flex h-2.5 w-2.5 items-center justify-center rounded-full bg-emerald-500 ring-2 ring-app"})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h1",{className:"text-sm font-bold tracking-tight text-ink font-heading",children:"ProFiles"}),n&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-ink-faint",children:"/"}),h.jsx("span",{className:"text-xs font-medium text-chip-indigo-text bg-chip-indigo-bg px-2 py-0.5 rounded-md border border-chip-indigo-border/50",children:n})]})]}),h.jsxs("p",{className:"text-[11px] font-medium text-ink-muted tracking-wide mt-0.5",children:["Crafted by ",h.jsx("span",{className:"text-ink font-semibold",children:"Florent ALBANY"})," • ",h.jsxs("span",{className:"font-mono text-chip-indigo-text",children:["v",r||"0.11.0-rc.2"]})]})]})]})}),h.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[h.jsxs("label",{className:"flex shrink-0 items-center gap-1.5 font-medium text-ink-secondary text-xs",children:[h.jsx(ss,{className:"h-3.5 w-3.5 text-chip-indigo-text"}),h.jsx("span",{children:"Directory:"})]}),h.jsx(He,{text:"Select or type a directory path to scan files from.",suppress:y,children:h.jsx(Sd,{id:"directory-combobox",ariaLabel:"Directory",value:u,options:a,onChange:s,onOpenChange:g,placeholder:"/path/to/directory",className:"w-full",inputClassName:"font-mono"})}),p&&h.jsx(He,{text:"Open the active directory in the OS file manager",block:!1,children:h.jsx("button",{type:"button",onClick:p,"aria-label":"Open active directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(U2,{className:"h-3.5 w-3.5"})})}),f&&h.jsx(He,{text:"Go to parent directory",block:!1,children:h.jsx("button",{type:"button",onClick:f,"aria-label":"Go to parent directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Vd,{className:"h-3.5 w-3.5 rotate-180"})})}),d&&h.jsx(He,{text:"Browse for a folder on this system",block:!1,children:h.jsx("button",{type:"button",onClick:d,"aria-label":"Browse directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Ji,{className:"h-3.5 w-3.5"})})}),x&&h.jsx(He,{text:"Open the active directory in a terminal",block:!1,children:h.jsx("button",{type:"button",onClick:()=>x(u),"aria-label":"Open directory in terminal",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(kd,{className:"h-3.5 w-3.5"})})}),m&&h.jsx(He,{text:"Set directory to your home folder",block:!1,children:h.jsx("button",{type:"button",onClick:m,"aria-label":"Go to home directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Yd,{className:"h-3.5 w-3.5"})})})]})]})}function yk({message:n,onRetry:r,retrying:a=!1}){return h.jsx("div",{className:"flex flex-1 items-center justify-center p-8",role:"alert","data-testid":"init-error-panel",children:h.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-line bg-surface p-6 text-center shadow-xl",children:[h.jsx("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-full border border-status-danger-border bg-status-danger-bg",children:h.jsx(lu,{className:"h-5 w-5 text-status-danger-text/80"})}),h.jsx("h3",{className:"text-sm font-semibold text-ink",children:"Couldn't load the app"}),h.jsx("p",{className:"mt-1 break-words text-xs text-ink-secondary",children:n}),h.jsxs("button",{type:"button",onClick:r,disabled:a,className:"btn btn-primary mx-auto mt-4 px-3.5 py-1.5 font-semibold shadow-sm",children:[h.jsx(cs,{className:`h-3.5 w-3.5 ${a?"animate-spin motion-reduce:animate-none":""}`}),h.jsx("span",{children:a?"Retrying...":"Retry"})]})]})})}const Ux=/"([^"]*)"|(\S+)/g,Bx=/"([^"]*)"/g,bk="Unmatched quote";function vk(n){const r=[];let a;for(Ux.lastIndex=0;(a=Ux.exec(n))!==null;){const f=a[1]!==void 0?a[1]:a[2];f&&f.trim()&&r.push(f)}let u="",s=0;Bx.lastIndex=0;let d;for(;(d=Bx.exec(n))!==null;)u+=n.slice(s,d.index),s=d.index+d[0].length;return u+=n.slice(s),{terms:r,error:u.includes('"')?bk:null}}function tb(n){const r=n.trim();if(!r)return{error:null,groups:[]};const{terms:a,error:u}=vk(r);if(a.length===0)return{error:u,groups:[]};const s=[];let d={includes:[],excludes:[]};for(const f of a){if(f.toUpperCase()==="OR"){s.push(d),d={includes:[],excludes:[]};continue}f==="-"||f==="+"||(f.startsWith("-")&&f.length>1?d.excludes.push(f.slice(1)):f.startsWith("+")&&f.length>1?d.includes.push(f.slice(1)):d.includes.push(f))}return s.push(d),{error:u,groups:s}}const wk=256,Ki=new Map;function Hx(n){return n.toLowerCase()}function kk(n){const r=Ki.get(n);if(r)return Ki.delete(n),Ki.set(n,r),r;const{groups:a}=tb(n),u={groups:a.map(s=>({includes:s.includes.map(Hx),excludes:s.excludes.map(Hx)}))};if(Ki.size>=wk){const s=Ki.keys().next().value;s!==void 0&&Ki.delete(s)}return Ki.set(n,u),u}function Sk(n,r){return r.includes.every(a=>n.includes(a))&&!r.excludes.some(a=>n.includes(a))}function Nk(n,r){const{groups:a}=kk(r);if(a.length===0)return!0;const u=n.toLowerCase();return a.some(s=>Sk(u,s))}function Ek({query:n,visible:r}){if(!r)return null;const a=tb(n);return a.error?h.jsx("div",{"data-testid":"filter-syntax-helper",className:"pointer-events-none absolute left-0 right-0 top-full z-[var(--z-syntax-helper)] mt-1 rounded-md border border-status-danger-border bg-surface-strong px-3 py-2 text-[11px] leading-5 text-status-danger-text/90 shadow-xl",children:a.error}):a.groups.length===0?null:h.jsxs("div",{"data-testid":"filter-syntax-helper",className:"pointer-events-none absolute left-0 right-0 top-full z-[var(--z-syntax-helper)] mt-1 rounded-md border border-line bg-surface-strong px-3 py-2 text-[11px] leading-5 text-ink-secondary shadow-xl",children:[h.jsx("span",{className:"mr-1.5 align-[1px] text-[10px] uppercase tracking-wide text-ink-muted",children:"reads as"}),a.groups.map((u,s)=>h.jsxs("span",{"data-testid":"filter-syntax-group",children:[s>0&&h.jsx("span",{className:"mx-1 font-mono text-chip-indigo-text",children:"OR"}),u.includes.map((d,f)=>h.jsxs("span",{children:[f>0&&h.jsx("span",{className:"text-ink-muted",children:" · "}),h.jsx("span",{className:"font-mono text-chip-indigo-text",children:d})]},`i-${f}`)),u.includes.length>0&&u.excludes.length>0&&h.jsx("span",{className:"text-ink-muted",children:" · "}),u.excludes.map((d,f)=>h.jsxs("span",{children:[f>0&&h.jsx("span",{className:"text-ink-muted",children:" · "}),h.jsx("span",{className:"text-ink-muted",children:"✕ "}),h.jsx("span",{className:"font-mono text-status-danger-text/70 line-through",children:d})]},`x-${f}`))]},s))]})}const qx=h.jsxs("span",{className:"flex flex-col gap-1 whitespace-nowrap text-left",children:[h.jsx("span",{className:"font-semibold",children:"Supported operators"}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"a b"})," — AND (both terms)"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"a OR b"})," — either term"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"-a"})," — NOT (exclude)"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"+a"})," — force include"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:'"a b"'})," — exact phrase"]})]});function jk({extensions:n,activeExtension:r,onExtensionChange:a,filterOptions:u,filterText:s,onFilterTextChange:d,recursive:f,onRecursiveChange:m,onScan:p,scanning:x,barcodeMode:y,onBarcodeToggle:g,onCameraBarcodeClick:w,autoRescanActive:v,onTimerClick:S}){const[T,L]=_.useState(!1),[D,$]=_.useState(!1),[I,J]=_.useState(!1);return h.jsxs("div",{className:"flex w-full flex-wrap items-center gap-3 border-b border-line bg-surface-glass p-3 text-xs",children:[h.jsx(He,{text:qx,suppress:D,children:h.jsxs("div",{className:"relative min-w-0 flex-1 basis-64",onFocusCapture:ie=>{ie.target.tagName==="INPUT"&&L(!0)},onBlurCapture:ie=>{ie.target.tagName==="INPUT"&&L(!1)},children:[h.jsx($y,{className:"pointer-events-none absolute left-3 top-1/2 z-10 h-4 w-4 -translate-y-1/2 text-ink-secondary"}),h.jsx(Sd,{id:"filter-combobox",ariaLabel:"File filter",value:s,options:u||[],onChange:d,onOpenChange:$,placeholder:"Filter files: keyword, a OR b, -tag, exact phrase...",className:"w-full",inputClassName:"pl-9 pr-3",optionLabel:ie=>ie||"(No filter)"}),h.jsx(Ek,{query:s,visible:T&&!D&&s.trim().length>0})]})}),h.jsx(He,{text:qx,block:!1,suppress:I,children:h.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[h.jsx("span",{className:"text-ink-muted",children:"Ext:"}),h.jsx(Sd,{id:"extension-combobox",ariaLabel:"Extension filter",value:r,options:n,onChange:a,onOpenChange:J,placeholder:".py OR .toml",className:"w-44",inputClassName:"font-mono px-2.5"})]})}),h.jsx(He,{text:"Include subdirectories when scanning",block:!1,children:h.jsxs("label",{className:"flex shrink-0 cursor-pointer select-none items-center gap-1.5 text-ink-secondary",children:[h.jsx("input",{type:"checkbox",checked:f,onChange:ie=>m(ie.target.checked),className:"rounded border-line text-chip-indigo-text focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-1 focus-visible:ring-offset-app"}),h.jsx("span",{children:"Recursive"})]})}),h.jsx(He,{text:"Run the scan with the current criteria (Enter)",block:!1,children:h.jsxs("button",{onClick:p,disabled:x,className:"btn btn-primary shrink-0 px-3.5 py-1.5 font-semibold shadow-sm",children:[x?h.jsx(cs,{className:"h-3.5 w-3.5 animate-spin motion-reduce:animate-none"}):h.jsx(er,{className:"h-3.5 w-3.5 fill-current"}),h.jsx("span",{children:x?"Scanning...":"Scan"})]})}),h.jsx(He,{text:v?"Auto-rescan is active. Click to configure.":"Configure periodic auto-rescan (hot-folder mode)",block:!1,children:h.jsx("button",{type:"button",onClick:S,"aria-label":"Configure timer / auto-rescan",className:`flex shrink-0 items-center justify-center rounded-md border p-1.5 text-ink-secondary hover:border-indigo-500 hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 transition-colors ${v?"border-chip-indigo-border bg-chip-indigo-bg text-chip-indigo-text":"border-line bg-elevated"}`,children:h.jsx(Jy,{className:`h-3.5 w-3.5 ${v?"animate-pulse":""}`})})}),h.jsx(He,{text:"Toggle barcode scanner mode (USB HID). When active, scan a barcode to auto-fill controls and trigger a scan.",block:!1,children:h.jsx("button",{type:"button",onClick:g,"aria-label":y?"Disable barcode mode":"Enable barcode mode",className:`flex shrink-0 items-center justify-center rounded-md border p-1.5 text-ink-secondary hover:border-indigo-500 hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 transition-colors ${y?"border-chip-indigo-border bg-chip-indigo-bg text-chip-indigo-text":"border-line bg-elevated"}`,children:h.jsx(Gd,{className:`h-3.5 w-3.5 ${y?"animate-pulse":""}`})})}),w&&h.jsx(He,{text:"Scan barcode or QR code using webcam / camera (Ctrl + Shift + B)",block:!1,children:h.jsx("button",{type:"button",onClick:w,"aria-label":"Scan barcode with camera",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Xy,{className:"h-3.5 w-3.5"})})})]})}const Ck=2e3,Tk=500,_k=[{value:null,label:"ALL"},{value:"DEBUG",label:"DEBUG"},{value:"INFO",label:"INFO"},{value:"WARNING",label:"WARNING"},{value:"ERROR",label:"ERROR"},{value:"CRITICAL",label:"CRITICAL"}],Fx={DEBUG:{icon:V2,className:"text-chip-sky-text"},INFO:{icon:Ky,className:"text-status-success-text"},WARNING:{icon:Wy,className:"text-status-warning-text"},ERROR:{icon:bd,className:"text-status-danger-text"},CRITICAL:{icon:bd,className:"text-status-danger-text"},UNKNOWN:{icon:Pr,className:"text-ink-faint"}};function Ak({isOpen:n,onClose:r,onOpenExternally:a}){const[u,s]=_.useState([]),[d,f]=_.useState("profiles.log"),[m,p]=_.useState(0),[x,y]=_.useState(null),[g,w]=_.useState(""),[v,S]=_.useState(!1),[T,L]=_.useState(!0),[D,$]=_.useState(null),[I,J]=_.useState(!0),ie=_.useRef(null),U=_.useRef(null),R=_.useRef(null),Q=_.useRef(null),fe=_.useRef(T),B=_.useRef({level:x,search:g});fe.current=T,B.current={level:x,search:g};const ne=_.useCallback(async()=>{const{level:A,search:W}=B.current;S(!0);try{const le=await o2({limit:Tk,level:A,search:W});s(le.entries),f(le.path),p(le.size_bytes),$(null)}catch(le){$((le==null?void 0:le.message)||"Failed to read the log file")}finally{S(!1)}},[]);_.useEffect(()=>{n&&ne()},[n,ne]),_.useEffect(()=>{if(!n||!T)return;const A=window.setInterval(()=>{ne()},Ck);return()=>window.clearInterval(A)},[n,T,ne]),_.useEffect(()=>{if(!n)return;const A=window.setTimeout(()=>void ne(),250);return()=>window.clearTimeout(A)},[n,x,g,ne]),_.useEffect(()=>{if(!I)return;const A=R.current;A&&(A.scrollTop=A.scrollHeight)},[u,I]),_.useEffect(()=>{if(!n)return;const A=document.activeElement instanceof HTMLElement?document.activeElement:null,W=requestAnimationFrame(()=>{var le;return(le=U.current)==null?void 0:le.focus()});return()=>{cancelAnimationFrame(W),A==null||A.focus()}},[n]);const V=A=>{var N;if(A.key==="Escape"){A.preventDefault(),r();return}if(A.key!=="Tab")return;const W=(N=ie.current)==null?void 0:N.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(!(W!=null&&W.length))return;const le=W[0],re=W[W.length-1];A.shiftKey&&document.activeElement===le?(A.preventDefault(),re.focus()):!A.shiftKey&&document.activeElement===re&&(A.preventDefault(),le.focus())},se=()=>{const A=R.current;if(!A)return;const W=A.scrollHeight-A.scrollTop-A.clientHeight<24;J(W)},ve=async()=>{try{await navigator.clipboard.writeText(u.map(A=>A.raw).join(` +`))}catch{}},ae=_.useMemo(()=>{const A=new Map;for(const W of u)A.set(W.level,(A.get(W.level)??0)+1);return A},[u]);return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/65 p-3 backdrop-blur-sm sm:p-6",onClick:r,children:h.jsxs("div",{ref:ie,role:"dialog","aria-modal":"true","aria-labelledby":"log-viewer-title",onKeyDown:V,className:"animate-modal-in flex h-[min(84dvh,760px)] w-[clamp(560px,85vw,1500px)] min-h-0 flex-col overflow-hidden rounded-xl border border-frame-line glass-panel sm:rounded-2xl",onClick:A=>A.stopPropagation(),children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-b border-line px-5 py-4 sm:px-6",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[h.jsx("span",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Pr,{className:"h-5 w-5 text-chip-indigo-text","aria-hidden":"true"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{id:"log-viewer-title",className:"text-base font-semibold text-ink",children:"Application logs"}),h.jsxs("p",{className:"truncate font-mono text-xs text-ink-muted",children:[d,h.jsxs("span",{className:"text-ink-faint",children:[" · ",Vx(m)]})]})]})]}),h.jsxs("div",{className:"relative min-w-[220px] flex-1",children:[h.jsx($y,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ink-faint","aria-hidden":"true"}),h.jsx("input",{ref:Q,type:"search",value:g,onChange:A=>w(A.target.value),placeholder:"Filter log lines…","aria-label":"Filter log lines",className:"w-full rounded-lg border border-line bg-elevated py-1.5 pl-8 pr-2.5 font-mono text-xs text-ink placeholder:text-ink-faint focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400"})]}),h.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[h.jsx(He,{text:T?"Pause live tail":"Resume live tail",block:!1,children:h.jsxs("button",{type:"button",onClick:()=>L(A=>!A),"aria-pressed":T,className:`flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400 ${T?"border-status-success-border bg-status-success-bg text-status-success-text":"border-line bg-elevated text-ink-muted hover:text-ink"}`,children:[h.jsx("span",{className:`h-2 w-2 rounded-full ${T?"bg-emerald-400":"bg-ink-faint"}`,"aria-hidden":"true"}),T?"Live":"Paused"]})}),h.jsx(He,{text:"Refresh now",block:!1,children:h.jsx("button",{type:"button",onClick:()=>void ne(),disabled:v,className:"rounded-lg border border-line bg-elevated p-2 text-ink-muted hover:text-ink disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(cs,{className:`h-4 w-4 ${v?"animate-spin":""}`,"aria-hidden":"true"})})}),h.jsx(He,{text:"Copy visible lines",block:!1,children:h.jsx("button",{type:"button",onClick:()=>void ve(),disabled:u.length===0,className:"rounded-lg border border-line bg-elevated p-2 text-ink-muted hover:text-ink disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(An,{className:"h-4 w-4","aria-hidden":"true"})})}),h.jsx(He,{text:"Open log file in the default application",block:!1,children:h.jsx("button",{type:"button",onClick:()=>{a==null||a(),r()},className:"rounded-lg border border-line bg-elevated p-2 text-ink-muted hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(ow,{className:"h-4 w-4","aria-hidden":"true"})})}),h.jsx(He,{text:"Close",block:!1,children:h.jsx("button",{ref:U,type:"button",onClick:r,className:"rounded-lg p-2 text-ink-muted hover:bg-hover-surface hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(nl,{className:"h-4 w-4","aria-hidden":"true"})})})]})]}),h.jsxs("div",{ref:R,onScroll:se,className:"min-h-0 flex-1 overflow-y-auto overscroll-contain bg-app px-2 py-2 font-mono text-xs leading-relaxed sm:px-3",children:[h.jsxs("div",{className:"sticky top-0 z-10 mb-1 flex items-center gap-2 rounded-md border border-line/40 bg-surface/60 px-2 py-1 text-[10px] font-bold uppercase tracking-wider text-ink-muted shadow-sm backdrop-blur-md",role:"row",children:[h.jsx("span",{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),h.jsx("span",{className:"w-[138px] shrink-0 text-ink/70",children:"Time"}),h.jsx("span",{className:"w-[52px] shrink-0 text-ink/70",children:"Level"}),h.jsx("span",{className:"w-[150px] shrink-0 text-ink/70",children:"Source"}),h.jsx("span",{className:"min-w-0 flex-1 text-ink/70",children:"Message"})]}),D&&h.jsx("p",{role:"alert",className:"px-3 py-6 text-center text-xs text-status-danger-text",children:D}),!D&&u.length===0&&!v&&h.jsx("p",{className:"px-3 py-6 text-center text-xs text-ink-faint",children:"No log entries match the current filters."}),h.jsx("ul",{className:"space-y-0.5",children:u.map((A,W)=>{const le=Fx[A.level]??Fx.UNKNOWN,re=le.icon,N=A.level==="ERROR"||A.level==="CRITICAL";return h.jsxs("li",{className:`group flex items-start gap-2 rounded px-2 py-1 ${N?"bg-status-danger-bg/40":"hover:bg-elevated/50"}`,children:[h.jsx("span",{className:le.className,children:h.jsx(re,{className:"mt-0.5 h-3.5 w-3.5","aria-hidden":"true"})}),h.jsx("span",{className:"w-[138px] shrink-0 text-ink-faint",children:A.timestamp}),h.jsx("span",{className:`w-[52px] shrink-0 text-[10px] font-semibold ${le.className}`,children:A.level}),h.jsx("span",{className:"w-[150px] shrink-0 truncate text-ink-faint",title:A.source,children:A.source}),h.jsx("span",{className:"min-w-0 flex-1 break-words text-ink-secondary",children:A.message})]},`${W}-${A.raw}`)})})]}),h.jsx("div",{className:"border-t border-line/60 bg-elevated/50 px-5 py-2.5 text-[11px] text-ink-faint shadow-sm backdrop-blur-md sm:px-6",children:h.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[h.jsx("span",{className:"mr-auto min-w-0 max-w-full basis-full truncate sm:basis-auto",role:"status","aria-atomic":"true",children:v&&u.length===0?"Loading log entries…":`${u.length} of ${Vx(m)} shown`}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"flex overflow-hidden rounded-lg border border-line/60 text-[11px] backdrop-blur-sm",role:"group","aria-label":"Filter by log level",children:_k.map(A=>{const W=x===A.value,le=A.value?ae.get(A.value)??0:u.length;return h.jsxs("button",{type:"button",onClick:()=>y(A.value),"aria-pressed":W,title:A.value?`Show ${A.value} and above`:"Show all levels",className:`flex items-center gap-1 px-2.5 py-1 font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-400 ${W?"bg-indigo-600 text-white":"text-ink-muted hover:bg-elevated hover:text-ink"}`,children:[A.label,h.jsx("span",{className:W?"text-chip-indigo-text":"text-ink-faint",children:le})]},A.label)})}),h.jsx(He,{text:"Scroll to the newest entry",block:!1,children:h.jsxs("button",{type:"button",onClick:()=>J(!0),"aria-pressed":I,className:`flex items-center gap-1.5 rounded-lg border px-2.5 py-1 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400 ${I?"border-chip-indigo-border bg-chip-indigo-bg text-chip-indigo-text":"border-line bg-elevated text-ink-muted hover:text-ink"}`,children:[h.jsx(Qy,{className:"h-3.5 w-3.5","aria-hidden":"true"}),h.jsx("span",{className:"hidden sm:inline",children:"Follow tail"})]})})]}),h.jsxs("span",{className:"hidden items-center gap-1.5 lg:flex",children:[h.jsx("span",{className:"hidden sm:inline",children:"Ctrl + Shift + L"}),h.jsx("span",{children:"opens externally"})]})]})})]})}):null}function Vx(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}const Yx='button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], video[tabindex], [tabindex]:not([tabindex="-1"])';function Wr({isOpen:n,onClose:r,dialogRef:a,initialFocusRef:u}){return _.useEffect(()=>{if(!n)return;const s=document.activeElement instanceof HTMLElement?document.activeElement:null,d=requestAnimationFrame(()=>{var p;const m=(u==null?void 0:u.current)??((p=a.current)==null?void 0:p.querySelector(Yx))??a.current;m==null||m.focus()}),f=m=>{if(m.key!=="Tab")return;const p=a.current;if(!p)return;const x=Array.from(p.querySelectorAll(Yx));if(!x.length)return;const y=x[0],g=x[x.length-1],w=document.activeElement;if(!(w instanceof Node&&p.contains(w))){m.preventDefault(),(m.shiftKey?g:y).focus();return}m.shiftKey&&(w===y||w===p)?(m.preventDefault(),g.focus()):!m.shiftKey&&(w===g||w===p)&&(m.preventDefault(),y.focus())};return window.addEventListener("keydown",f,!0),()=>{cancelAnimationFrame(d),s==null||s.focus(),window.removeEventListener("keydown",f,!0)}},[n]),s=>{s.key==="Escape"&&(s.preventDefault(),s.stopPropagation(),r())}}function zk({isOpen:n,onClose:r}){const a=_.useRef(null),u=Wr({isOpen:n,onClose:r,dialogRef:a});if(!n)return null;const s=[{key:"F5",desc:"Refresh / re-scan file list"},{key:"Ctrl + R",desc:"Reload configuration & scan"},{key:"Enter",desc:"Execute / launch selected file"},{key:"P",desc:"Open properties for selected file"},{key:"↑ / ↓",desc:"Navigate file list"},{key:"Home / End",desc:"Jump to first / last file"},{key:"PageUp / PageDown",desc:"Page through the file list"},{key:"Ctrl + D",desc:"Focus Directory field"},{key:"Ctrl + E",desc:"Focus Extension field"},{key:"Ctrl + F",desc:"Focus Filter / Search field"},{key:"Ctrl + L",desc:"Focus File List"},{key:"Ctrl + Shift + L",desc:"Open the log viewer"},{key:"Ctrl + ,",desc:"Open config file"},{key:"Ctrl + Shift + T",desc:"Toggle theme (Dark / Light)"},{key:"Ctrl + B",desc:"Toggle barcode scanner mode"},{key:"Ctrl + Shift + B",desc:"Open webcam / camera barcode scanner"},{key:"Ctrl + T",desc:"Open auto-rescan timer modal"},{key:"Ctrl + H",desc:"Set directory to home folder"},{key:"? or Ctrl + /",desc:"Show keyboard shortcuts"},{key:"Y / S / N",desc:"Answer workflow guard: Yes / Skip / No (prompt open)"},{key:"Enter",desc:"Confirm active workflow prompt (prompt open)"},{key:"Escape",desc:"Close dialogs / context menu"}];return h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",children:h.jsxs("div",{ref:a,role:"dialog","aria-modal":"true","aria-label":"Keyboard Shortcuts",onKeyDown:u,className:"animate-modal-in w-[450px] max-w-full rounded-2xl border border-frame-line glass-panel p-5",children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink",children:[h.jsx(Zy,{className:"h-5 w-5 text-chip-indigo-text"}),h.jsx("span",{children:"Keyboard Shortcuts"})]}),h.jsx("button",{onClick:r,className:"focus-ring rounded-lg p-1 text-ink-muted hover:bg-elevated hover:text-ink",children:h.jsx(nl,{className:"h-4 w-4"})})]}),h.jsx("div",{className:"max-h-[60vh] space-y-2 overflow-y-auto pr-1 text-xs",children:s.map(({key:d,desc:f})=>h.jsxs("div",{className:"flex items-center justify-between rounded-lg bg-elevated/50 px-3 py-2",children:[h.jsx("span",{className:"text-ink-secondary",children:f}),h.jsx("kbd",{className:"rounded bg-app px-2 py-0.5 font-mono text-[11px] font-semibold text-chip-indigo-text border border-line",children:d})]},d))}),h.jsx("div",{className:"mt-5 flex justify-end",children:h.jsx("button",{onClick:r,className:"btn btn-primary rounded-lg px-4 py-2 font-semibold",children:"Close"})})]})})}function Dk({isOpen:n,activeConfigPath:r,configExists:a=!0,onClose:u,onLoaded:s}){const[d,f]=_.useState(null),[m,p]=_.useState(""),[x,y]=_.useState(null),[g,w]=_.useState(!1),[v,S]=_.useState(null),T=_.useRef(null),L=_.useRef(null),D=_.useRef(null),$=a===!1;_.useEffect(()=>{var ne;if(!n){(ne=D.current)==null||ne.focus();return}D.current=document.activeElement instanceof HTMLElement?document.activeElement:null,S(null);const R=r??"",Q=Math.max(R.lastIndexOf("/"),R.lastIndexOf("\\")),fe=Q>0?R.slice(0,Q):"";I(fe);const B=requestAnimationFrame(()=>{var V;return(V=L.current)==null?void 0:V.focus()});return()=>{var V;cancelAnimationFrame(B),(V=D.current)==null||V.focus()}},[n,r]);const I=async R=>{w(!0),S(null);try{const Q=await p2(R);f(Q),p(Q.current_path),r&&Q.items.some(fe=>fe.path===r)?y(r):y(null)}catch(Q){S(Q.message||"Navigation failed")}finally{w(!1)}},J=R=>{var ne;if(R.key==="Escape"){R.preventDefault(),u();return}if(R.key!=="Tab")return;const Q=(ne=T.current)==null?void 0:ne.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(!(Q!=null&&Q.length))return;const fe=Q[0],B=Q[Q.length-1];R.shiftKey&&document.activeElement===fe?(R.preventDefault(),B.focus()):!R.shiftKey&&document.activeElement===B&&(R.preventDefault(),fe.focus())},ie=async()=>{var Q;const R=x||(((Q=d==null?void 0:d.items.find(fe=>fe.is_config))==null?void 0:Q.path)??null);if(!R){S("Select a configuration file to load.");return}try{w(!0);const fe=await f2(R);s(fe),u()}catch(fe){S(fe.message||"Unable to load configuration")}finally{w(!1)}},U=async()=>{const R=(m||(d==null?void 0:d.current_path)||"").trim();if(!R){S("Choose a directory before creating a configuration.");return}try{w(!0);const Q=await m2(R);s(Q),u()}catch(Q){S(Q.message||"Unable to create configuration")}finally{w(!1)}};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/65 p-3 backdrop-blur-sm sm:p-6",onClick:u,children:h.jsxs("div",{ref:T,role:"dialog","aria-modal":"true","aria-labelledby":"load-config-title",onKeyDown:J,className:"animate-modal-in flex h-[min(84dvh,760px)] max-h-[calc(100dvh-1.5rem)] w-[min(94vw,960px)] min-h-0 flex-col overflow-hidden rounded-xl border border-frame-line glass-panel sm:rounded-2xl",onClick:R=>R.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-line px-4 py-3 sm:px-5",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Kr,{className:"h-5 w-5 text-chip-indigo-text"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{id:"load-config-title",className:"text-sm font-semibold text-ink",children:$?"Create configuration":"Load configuration"}),h.jsx("p",{className:"truncate font-mono text-xs text-ink-muted",children:(d==null?void 0:d.current_path)||""})]})]}),h.jsx(He,{text:"Close",block:!1,children:h.jsx("button",{type:"button",onClick:u,"aria-label":"Close configuration modal",className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg text-ink-muted transition-colors hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(nl,{className:"h-4 w-4"})})})]}),$&&h.jsx("div",{className:"border-b border-line bg-chip-indigo-bg/20 px-4 py-3 text-xs text-ink-secondary",children:"No configuration file was found. Create one here?"}),h.jsxs("div",{className:"border-b border-line px-4 py-3 sm:px-5",children:[h.jsx("label",{htmlFor:"config-path-input",className:"mb-1.5 block text-xs font-medium text-ink-secondary",children:"Configuration directory"}),h.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[h.jsx("input",{ref:L,id:"config-path-input",type:"text",value:m,onChange:R=>p(R.target.value),onKeyDown:R=>{R.key==="Enter"&&I(m.trim())},placeholder:"/path/to/directory",className:"h-10 min-w-0 flex-1 rounded-lg border border-line bg-elevated px-2.5 font-mono text-sm text-ink outline-none placeholder:text-ink-faint transition-colors hover:bg-surface-strong focus-visible:border-indigo-500 focus-visible:ring-2 focus-visible:ring-indigo-500/30"}),h.jsx("button",{type:"button",onClick:()=>I(m.trim()),className:"inline-flex h-10 shrink-0 items-center gap-1.5 rounded-lg border border-line bg-elevated px-3.5 text-sm font-medium text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Go"}),h.jsx(He,{text:"Home directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>I(""),"aria-label":"Home directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Yd,{className:"h-4 w-4"})})}),(d==null?void 0:d.parent_path)&&h.jsx(He,{text:"Parent directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>I(d.parent_path),"aria-label":"Parent directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Vd,{className:"h-4 w-4 rotate-180"})})})]})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 py-2 sm:px-3 sm:py-3","aria-busy":g,children:g?h.jsxs("div",{className:"flex h-full items-center justify-center gap-2.5 text-sm text-ink-muted",children:[h.jsx(Wi,{className:"h-5 w-5 animate-spin text-chip-indigo-text"}),h.jsx("span",{role:"status",children:"Loading configuration files…"})]}):v?h.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-2.5 text-center",children:[h.jsx("p",{className:"text-sm text-status-danger-text",children:v}),h.jsx("button",{type:"button",onClick:()=>I(m||(d==null?void 0:d.current_path)||""),className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Retry"})]}):h.jsxs("ul",{className:"space-y-1",children:[d==null?void 0:d.items.map(R=>{if(R.is_dir)return h.jsx("li",{children:h.jsx("button",{onClick:()=>I(R.path),onDoubleClick:()=>I(R.path),className:"flex w-full items-center justify-between rounded-md px-3 py-1.5 text-left text-xs text-ink-secondary hover:bg-elevated",children:h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(ss,{className:"h-3.5 w-3.5 text-chip-indigo-text"}),R.name]})})},R.path);const Q=x===R.path;return h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>y(R.path),"aria-pressed":Q,className:`flex w-full items-center justify-between rounded-lg px-3 py-1.5 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-400 ${Q?"bg-chip-indigo-bg text-chip-indigo-text":"text-ink-secondary hover:bg-elevated hover:text-ink"}`,children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx(Pr,{className:"h-5 w-5 shrink-0 text-chip-amber-text"}),h.jsx("span",{className:"truncate",children:R.name})]}),R.is_config&&h.jsx(Kr,{className:"h-4 w-4 shrink-0 text-chip-indigo-text"}),Q&&h.jsx(vi,{className:"h-4 w-4 shrink-0 text-chip-indigo-text"})]})},R.path)}),(d==null?void 0:d.items.filter(R=>R.is_config).length)===0&&h.jsxs("li",{className:"flex h-full min-h-36 flex-col items-center justify-center gap-2.5 text-center text-sm text-ink-muted",children:[h.jsx(Pr,{className:"h-7 w-7 text-ink-faint"}),"No configuration files found"]})]})}),h.jsxs("div",{className:"flex flex-col gap-2 border-t border-line px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"mb-0.5 text-xs font-medium text-ink-muted",children:"Selected file"}),h.jsx("p",{className:"truncate font-mono text-sm text-ink",title:x||m,children:x||m||"—"})]}),h.jsxs("div",{className:"flex shrink-0 justify-end gap-1.5",children:[h.jsx("button",{type:"button",onClick:u,className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Cancel"}),$?h.jsxs("button",{type:"button",onClick:U,disabled:!m.trim(),className:"btn btn-primary min-h-10 rounded-lg px-4 text-sm font-semibold",children:[h.jsx(Kr,{className:"h-4 w-4"}),"Create configuration"]}):h.jsxs("button",{type:"button",onClick:ie,disabled:!x,className:"btn btn-primary min-h-10 rounded-lg px-4 text-sm font-semibold",children:[h.jsx(Kr,{className:"h-4 w-4"}),"Load configuration"]})]})]})]})}):null}function nb({isOpen:n,onClose:r,initialFilePath:a,md5:u}){const[s,d]=_.useState(null),[f,m]=_.useState(""),[p,x]=_.useState([]),[y,g]=_.useState(!1),[w,v]=_.useState(null),[S,T]=_.useState(!1),[L,D]=_.useState(!1),[$,I]=_.useState(null),J=_.useRef(null),ie=Wr({isOpen:n,onClose:r,dialogRef:J});_.useEffect(()=>{if(!n)return;async function ae(){if(a){g(!0);try{const A=await _x({filePath:a});d(A.image),m(A.content),U(A.content)}catch(A){v(A.message)}finally{g(!1)}}}ae()},[n,a]);const U=ae=>{const A=ae.split(";").map(W=>{const le=W.split("=");return{key:le[0]||"",value:le[1]||""}}).filter(W=>W.key||W.value);x(A)},R=async ae=>{const A=ae.filter(W=>W.key.trim()).map(W=>`${W.key.trim()}=${W.value.trim()}`).join(";");if(m(A),!A){d(null);return}try{const W=await _x({content:A});d(W.image)}catch(W){console.error("Failed to re-generate barcode:",W)}},Q=(ae,A,W)=>{const le=[...p];le[ae][A]=W,x(le),R(le)},fe=()=>{const ae=[...p,{key:"",value:""}];x(ae)},B=ae=>{const A=p.filter((W,le)=>le!==ae);x(A),R(A)},ne=()=>{if(!u||p.some(A=>A.key.toLowerCase()==="md5"))return;const ae=[...p,{key:"md5",value:u}];x(ae),R(ae)},V=async()=>{if(s){I("Saving…");try{const ae=await w2(s,`profiles-qr-${Date.now()}.png`);I(ae.path||ae.message)}catch(ae){I(`Save failed: ${(ae==null?void 0:ae.message)??ae}`)}finally{setTimeout(()=>I(null),6e3)}}},se=async()=>{try{await navigator.clipboard.writeText(f),T(!0),setTimeout(()=>T(!1),2e3)}catch(ae){console.error("Copy failed",ae)}},ve=async()=>{if(s)try{const A=await(await fetch(s)).blob();await navigator.clipboard.write([new ClipboardItem({[A.type]:A})]),D(!0),setTimeout(()=>D(!1),2e3)}catch(ae){console.error("Image copy failed",ae)}};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4",onClick:r,children:h.jsxs("div",{ref:J,role:"dialog","aria-modal":"true","aria-label":"QR Code Settings",onKeyDown:ie,className:"animate-modal-in w-full max-w-md rounded-xl border border-frame-line glass-panel p-6",onClick:ae=>ae.stopPropagation(),children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[h.jsx("h3",{className:"text-sm font-semibold text-ink",children:"QR Code Settings"}),h.jsx("button",{onClick:r,className:"focus-ring rounded-md p-1 text-ink-muted hover:bg-elevated hover:text-ink",children:h.jsx(nl,{className:"h-4 w-4"})})]}),y?h.jsx("div",{className:"flex h-48 items-center justify-center",children:h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-600 border-t-transparent"})}):w?h.jsx("div",{className:"rounded-md border border-status-danger-border bg-status-danger-bg p-4 text-center text-xs text-status-danger-text",children:w}):h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-col items-center gap-4",children:[h.jsxs("div",{className:"relative group",children:[h.jsx("div",{className:"h-48 w-48 overflow-hidden rounded-lg border border-line bg-white p-2",children:s?h.jsx("img",{src:s,alt:"QR Code",className:"h-full w-full object-contain"}):h.jsx("div",{className:"flex h-full items-center justify-center text-xs text-slate-400",children:"No content"})}),s&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-black/20 rounded-lg",children:h.jsxs("button",{onClick:ve,className:"focus-ring flex items-center gap-2 rounded-md bg-white/90 p-2 text-xs font-medium text-slate-900 shadow-sm hover:bg-white",children:[L?h.jsx(vi,{className:"h-3.5 w-3.5"}):h.jsx(An,{className:"h-3.5 w-3.5"}),L?"Copied":"Copy Image"]})})]}),h.jsxs("div",{className:"flex w-full gap-2",children:[h.jsxs("button",{onClick:se,className:"btn btn-secondary flex-1 px-3 py-1.5",children:[S?h.jsx(vi,{className:"h-3.5 w-3.5 text-status-success-text"}):h.jsx(An,{className:"h-3.5 w-3.5"}),"Copy Content"]}),h.jsxs("button",{onClick:V,disabled:!s,className:"btn btn-primary flex-1 px-3 py-1.5",children:[h.jsx(Iy,{className:"h-3.5 w-3.5"}),"Save Image"]})]}),$&&h.jsx("p",{className:"break-all text-center text-[11px] text-ink-muted",role:"status",children:$})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("label",{className:"text-xs font-medium text-ink-muted uppercase tracking-wider",children:"Payload Fields"}),h.jsxs("div",{className:"flex gap-2",children:[u&&!p.some(ae=>ae.key==="md5")&&h.jsxs("button",{onClick:ne,className:"btn-chip flex items-center gap-1 rounded px-2 py-0.5 text-[10px] font-bold text-chip-purple-text border border-chip-purple-border",children:[h.jsx(Zr,{className:"h-3 w-3"})," Inc. MD5"]}),h.jsxs("button",{onClick:fe,className:"btn-chip flex items-center gap-1 rounded px-2 py-0.5 text-[10px] font-bold text-chip-indigo-text border border-chip-indigo-border",children:[h.jsx(Uw,{className:"h-3 w-3"})," Add Field"]})]})]}),h.jsxs("div",{className:"max-h-48 space-y-2 overflow-y-auto pr-1 custom-scrollbar",children:[p.map((ae,A)=>h.jsxs("div",{className:"flex gap-2 items-center slide-in",children:[h.jsx("input",{type:"text",placeholder:"key",value:ae.key,onChange:W=>Q(A,"key",W.target.value),className:"w-1/3 rounded border border-line bg-elevated px-2 py-1 text-xs text-ink focus:border-indigo-500 focus:outline-none"}),h.jsx("input",{type:"text",placeholder:"value",value:ae.value,onChange:W=>Q(A,"value",W.target.value),className:"flex-1 rounded border border-line bg-elevated px-2 py-1 text-xs text-ink focus:border-indigo-500 focus:outline-none"}),h.jsx("button",{onClick:()=>B(A),className:"p-1 text-ink-muted hover:text-status-danger-text transition-colors","aria-label":"Remove field",children:h.jsx(Py,{className:"h-3.5 w-3.5"})})]},A)),p.length===0&&h.jsx("p",{className:"text-center py-4 text-xs text-ink-muted italic",children:"No fields defined"})]})]}),h.jsxs("div",{className:"pt-2 border-t border-line",children:[h.jsx("label",{className:"text-[10px] font-medium text-ink-muted uppercase tracking-wider block mb-1.5",children:"Raw Preview"}),h.jsx("div",{className:"rounded bg-elevated p-2 font-mono text-[10px] text-ink-secondary break-all border border-line",children:f||h.jsx("span",{className:"italic text-ink-muted/50",children:"empty"})})]})]})]})}):null}const Gx=["Bytes","KB","MB","GB","TB"];function lb(n){if(n===0)return"0 Bytes";const r=1024,a=Math.max(0,Math.min(Gx.length-1,Math.floor(Math.log(n)/Math.log(r))));return parseFloat((n/Math.pow(r,a)).toFixed(2))+" "+Gx[a]}function Mk(n){const r=Math.max(n.lastIndexOf("\\"),n.lastIndexOf("/"));return r===-1?"":n.slice(0,r)}function Ok(n){const r=[`File Properties: ${n.name}`,`Path: ${n.path}`,`Type: ${n.type}`,`Size: ${lb(n.size_bytes)}`,`Created: ${n.created}`,`Modified: ${n.modified}`];return n.md5&&r.push(`MD5: ${n.md5}`),n.sha256&&r.push(`SHA256: ${n.sha256}`),r.join(` +`)}function td(n,r,a){return n.length<=r+a+1?n:`${n.slice(0,r)}…${n.slice(-a)}`}function Rk(n){const r=n.includes("\\")?"\\":"/",a=n.split(/[\\/]/);return a.length<=5?n:[a[0],a[1],"…",a[a.length-2],a[a.length-1]].join(r)}const Lk=[{ms:1e3*60,unit:"minute"},{ms:1e3*60*60,unit:"hour"},{ms:1e3*60*60*24,unit:"day"},{ms:1e3*60*60*24*30,unit:"month"},{ms:1e3*60*60*24*365,unit:"year"}];function Qx(n,r=new Date){const a=new Date(n.replace(" ","T"));if(Number.isNaN(a.getTime()))return"just now";const u=r.getTime()-a.getTime();if(u<6e4)return"just now";let s="just now";for(const{ms:d,unit:f}of Lk){if(u{var V;n||((V=I.current)==null||V.focus(),v(!1))},[n]),_.useEffect(()=>{if(!n||!r)return;const V=new AbortController;return J.current=V,d(null),D(null),m(!0),x(null),(async()=>{try{const se=await b2(r.path,V.signal);if(J.current!==V)return;d(se)}catch(se){if(J.current!==V||se instanceof DOMException&&se.name==="AbortError")return;x(se instanceof Error?se.message:"Failed to load properties")}finally{J.current===V&&m(!1)}})(),()=>{J.current=null,V.abort()}},[n,r]),_.useEffect(()=>{if(!n)return;const V=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=V}},[n]),_.useEffect(()=>{if(!n)return;const V=se=>{if(se.key==="Escape"){if(w)return;a();return}if(se.key!=="Tab")return;const ve=$.current;if(!ve)return;const ae=Array.from(ve.querySelectorAll('button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(re=>re.offsetParent!==null);if(ae.length===0)return;const A=ae[0],W=ae[ae.length-1],le=document.activeElement instanceof HTMLElement?document.activeElement:null;se.shiftKey?(le===A||!ve.contains(le))&&(se.preventDefault(),W.focus()):le===W&&(se.preventDefault(),A.focus())};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[n,w,a]),_.useEffect(()=>{if(!n)return;const V=document.activeElement instanceof HTMLElement?document.activeElement:null;I.current=V;const se=requestAnimationFrame(()=>{var ve,ae;(ae=(ve=$.current)==null?void 0:ve.querySelector("button"))==null||ae.focus()});return()=>cancelAnimationFrame(se)},[n]);const ie=async(V,se)=>{try{await navigator.clipboard.writeText(V),g(se),setTimeout(()=>g(null),2e3)}catch(ve){console.error("Failed to copy:",ve)}},U=async(V,se,ve)=>{T(V),D(null);try{await ve(),D(se)}catch{D("Action failed")}finally{T(null)}},R=V=>`btn btn-chip rounded-md border px-3 py-2 text-xs ${{reveal:"bg-chip-sky-bg text-chip-sky-text border-chip-sky-border",launch:"border-emerald-500/30 bg-emerald-600 font-semibold text-white hover:bg-emerald-500",folder:"bg-chip-amber-bg text-chip-amber-text border-chip-amber-border"}[V]??"bg-chip-indigo-bg text-chip-indigo-text border-chip-indigo-border"}`,Q=(V,se,ve,ae=!1,A)=>h.jsxs("div",{className:"flex items-start gap-2 py-1.5 group",children:[h.jsxs("span",{className:"text-ink-muted min-w-[100px] text-xs",children:[V,":"]}),h.jsx("div",{className:"flex-1 min-w-0",children:h.jsx("span",{className:`text-ink text-xs break-all ${ae?"font-mono":""}`,children:A??se})}),h.jsx(He,{text:"Copy to clipboard",block:!1,children:h.jsx("button",{onClick:()=>ie(se,ve),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-elevated","aria-label":`Copy ${V}`,children:y===ve?h.jsx(vi,{className:"h-3.5 w-3.5 text-status-success-text"}):h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted"})})})]}),fe=(V,se,ve)=>h.jsxs("div",{className:"rounded-lg border border-line bg-elevated p-4",children:[h.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[se,h.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-ink-muted",children:V})]}),ve]}),B=()=>h.jsx(He,{text:"Click to copy full path",children:h.jsxs("button",{onClick:()=>void ie(s.path,"path"),className:"group mb-3 flex w-full items-center gap-2 rounded-lg border border-line bg-elevated px-3 py-2 text-left hover:bg-surface",children:[h.jsx(ss,{className:"text-chip-amber-text h-4 w-4 flex-shrink-0"}),h.jsx("span",{className:"text-ink min-w-0 flex-1 truncate font-mono text-xs",children:Rk(s.path)}),y==="path"?h.jsx(vi,{className:"text-status-success-text h-3.5 w-3.5"}):h.jsx(An,{className:"text-ink-muted h-3.5 w-3.5"})]})});if(!n||!r)return null;const ne=r;return h.jsxs("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 backdrop-blur-md p-4",role:"dialog","aria-modal":"true","aria-labelledby":"properties-modal-title",children:[h.jsx("div",{className:"absolute inset-0",onClick:a,onContextMenu:V=>{V.preventDefault(),a()}}),h.jsxs("div",{ref:$,className:"animate-modal-in relative w-full max-w-4xl max-h-[90vh] overflow-hidden rounded-xl border border-frame-line glass-panel flex flex-col",children:[h.jsx("div",{className:"flex-shrink-0 border-b border-line px-6 py-4",children:h.jsxs("div",{className:"flex items-start justify-between gap-4",children:[h.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[h.jsx("div",{className:"rounded-lg bg-indigo-600 p-2 flex-shrink-0",children:h.jsx(Wf,{className:"h-5 w-5 text-white"})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("h3",{id:"properties-modal-title",className:"text-base font-semibold text-ink truncate",children:"File Properties"}),h.jsx("p",{className:"text-xs text-ink-muted truncate",children:r.filename})]}),h.jsx(He,{text:"Copy all properties to clipboard",block:!1,children:h.jsx("button",{onClick:()=>{s&&ie(Ok(s),"all")},disabled:!s||f||p!==null,className:"btn-chip ml-2 flex items-center gap-1 rounded-md border border-chip-indigo-border bg-chip-indigo-bg p-1.5 text-chip-indigo-text","aria-label":"Copy all properties",children:y==="all"?h.jsx(vi,{className:"h-4 w-4 text-status-success-text"}):h.jsx(An,{className:"h-4 w-4"})})}),h.jsx(He,{text:"Generate Barcode/QR Code",block:!1,children:h.jsx("button",{onClick:()=>v(!0),className:"btn-chip rounded-md border border-chip-indigo-border bg-chip-indigo-bg p-1.5 text-chip-indigo-text",children:h.jsx(Gd,{className:"h-4 w-4"})})})]}),h.jsx("button",{onClick:a,className:"focus-ring rounded-md p-1 text-ink-muted hover:bg-elevated hover:text-ink flex-shrink-0","aria-label":"Close",children:h.jsx(nl,{className:"h-4 w-4"})})]})}),h.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:[f&&h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsxs("div",{className:"flex flex-col items-center gap-2",children:[h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-600 border-t-transparent"}),h.jsx("p",{className:"text-xs text-ink-muted",children:"Loading properties..."})]})}),p&&h.jsx("div",{className:"rounded-lg border border-status-danger-border bg-status-danger-bg p-4 text-center",children:h.jsx("p",{className:"text-xs text-status-danger-text",children:p})}),s&&!f&&!p&&h.jsxs("div",{children:[h.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-x-4 gap-y-1.5 rounded-lg border border-line bg-elevated px-4 py-2.5",children:[h.jsx("span",{className:"inline-flex items-center gap-1 rounded-md border border-chip-indigo-border bg-chip-indigo-bg px-2 py-0.5 text-xs font-semibold text-chip-indigo-text",children:s.type}),s.attributes.extension&&h.jsx("span",{className:"inline-flex items-center rounded-md border border-line bg-surface px-2 py-0.5 text-xs font-medium text-ink-muted",children:s.attributes.extension}),h.jsxs("span",{className:"text-xs text-ink-muted",title:`${s.size_bytes} bytes`,children:["Size ",h.jsx("strong",{className:"text-ink font-medium",children:lb(s.size_bytes)})]}),h.jsxs("span",{className:"text-xs text-ink-muted",title:s.created,children:["Created ",h.jsx("strong",{className:"text-ink font-medium",children:Qx(s.created)})]}),h.jsxs("span",{className:"text-xs text-ink-muted",title:s.modified,children:["Modified ",h.jsx("strong",{className:"text-ink font-medium",children:Qx(s.modified)})]}),s.md5&&h.jsx("span",{className:"inline-flex items-center rounded-md border border-chip-purple-border bg-chip-purple-bg px-2 py-0.5 font-mono text-xs font-medium text-chip-purple-text",title:`MD5 ${s.md5}`,children:td(s.md5,4,4)}),s.attributes.is_symlink&&h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-chip-fuchsia-border bg-chip-fuchsia-bg px-2 py-0.5 text-xs font-medium text-chip-fuchsia-text",children:[h.jsx(Cw,{className:"h-3 w-3"})," Symlink"]})]}),B(),h.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[fe("Hashes",h.jsx(Zr,{className:"text-chip-purple-text h-3.5 w-3.5"}),h.jsxs("div",{className:"space-y-0.5",children:[Q("MD5",s.md5,"md5",!0,td(s.md5,10,6)),Q("SHA256",s.sha256,"sha256",!0,td(s.sha256,10,6))]})),fe("Timestamps",h.jsx(G2,{className:"text-chip-sky-text h-3.5 w-3.5"}),h.jsxs("div",{className:"space-y-0.5",children:[Q("Created",s.created,"created",!0),Q("Modified",s.modified,"modified",!0)]})),fe("Identity",h.jsx(Wf,{className:"text-chip-indigo-text h-3.5 w-3.5"}),h.jsxs("div",{className:"space-y-0.5",children:[Q("Type",s.type,"type"),s.attributes.stem&&Q("Stem",s.attributes.stem,"attrStem"),Q("Extension",s.name.includes(".")?s.name.slice(s.name.lastIndexOf(".")):"None","extension"),Q("Directory",Mk(s.path)||"None","directory",!0)]})),fe("System",h.jsx(Wf,{className:"text-status-success-text h-3.5 w-3.5"}),h.jsxs("div",{children:[h.jsxs("div",{className:"mb-1 flex min-h-[24px] flex-wrap items-center gap-1.5",children:[s.attributes.is_readonly&&h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-status-danger-border bg-status-danger-bg px-2 py-0.5 text-xs text-status-danger-text",children:[h.jsx(Aw,{className:"h-3 w-3"})," Read-only"]}),s.attributes.is_hidden&&h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-slate-500/30 bg-slate-600/20 px-2 py-0.5 text-xs text-slate-300",children:[h.jsx(cw,{className:"h-3 w-3"})," Hidden"]}),!s.attributes.is_readonly&&!s.attributes.is_hidden&&!s.attributes.is_symlink&&h.jsx("span",{className:"text-xs text-ink-muted",children:"No special flags"})]}),h.jsxs("div",{className:"space-y-0.5",children:[Q("File Type",s.attributes.is_file?"Regular File":s.attributes.is_dir?"Directory":"Other","fileType"),s.attributes.permissions&&Q("Permissions",s.attributes.permissions,"permissions",!0),s.attributes.owner_uid!==void 0&&Q("Owner UID",String(s.attributes.owner_uid),"ownerUid"),s.attributes.group_gid!==void 0&&Q("Group GID",String(s.attributes.group_gid),"groupGid")]})]}))]})]})]}),h.jsx("div",{className:"flex-shrink-0 border-t border-line px-6 py-3",children:h.jsxs("div",{className:"flex justify-between items-center gap-2",children:[h.jsx("p",{className:"min-w-0 text-xs text-ink-muted truncate",children:L??"Click the copy icon next to any field to copy its value"}),h.jsxs("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[h.jsx(He,{text:"Show file in Explorer",block:!1,children:h.jsxs("button",{onClick:()=>void U("reveal","Revealed in Explorer",()=>Yy(ne.path)),disabled:S!==null,className:R("reveal"),children:[h.jsx(vd,{className:"h-3.5 w-3.5"})," Reveal"]})}),h.jsx(He,{text:"Launch file with default association",block:!1,children:h.jsxs("button",{onClick:()=>{u&&(T("launch"),Promise.resolve(u(ne)).finally(()=>T(null)))},disabled:S!==null||!u,className:R("launch"),children:[h.jsx(er,{className:"h-3.5 w-3.5"})," Launch"]})}),h.jsx(He,{text:"Open containing folder",block:!1,children:h.jsxs("button",{onClick:()=>void U("folder","Opened folder",()=>yd(ne.path)),disabled:S!==null,className:R("folder"),children:[h.jsx(Ji,{className:"h-3.5 w-3.5"})," Open Folder"]})}),h.jsx("button",{onClick:a,className:"btn btn-primary px-4 py-2",children:"Close"})]})]})})]}),h.jsx(nb,{isOpen:w,onClose:()=>v(!1),initialFilePath:r.path,md5:s==null?void 0:s.md5})]})}const Bk=["qr_code","code_128","code_39","ean_13","ean_8","upc_a","upc_e","data_matrix"],Hk=250,qk=400,Fk=.7;function Vk(n,r=qk,a=Fk){const u=n.videoWidth,s=n.videoHeight;if(!u||!s)return null;const d=Math.min(u,s),f=document.createElement("canvas");f.width=Math.min(r,d),f.height=f.width;const m=f.getContext("2d");if(!m)return null;m.drawImage(n,(u-d)/2,(s-d)/2,d,d,0,0,f.width,f.height);const p=f.toDataURL("image/jpeg",a);return p.slice(p.indexOf(",")+1)}function Yk(n,r){const a=n.intervalMs??Hk;let u=!1,s=!1;const d=()=>{u=!0,clearInterval(f)},f=setInterval(()=>{if(u||s)return;const m=n.capture();m&&(s=!0,n.decode(m).then(p=>{u||p.decoded&&(d(),r.onDetected(p.decoded))}).catch(p=>{u||(d(),r.onError(p instanceof Error?p.message:"Frame decoding failed"))}).finally(()=>{s=!1}))},a);return d}const Gk=8e3;function Qk({isOpen:n,onClose:r,onDetected:a}){const u=_.useRef(null),s=_.useRef(null),d=Wr({isOpen:n,onClose:r,dialogRef:s}),f=_.useRef(null),m=_.useRef(null),p=_.useRef(null),[x,y]=_.useState(null),[g,w]=_.useState(!1),v=()=>{p.current&&(p.current(),p.current=null),m.current&&(cancelAnimationFrame(m.current),m.current=null),f.current&&(f.current.getTracks().forEach(L=>L.stop()),f.current=null),u.current&&(u.current.srcObject=null)};_.useEffect(()=>{if(!n){v(),y(null);return}let L=!0;async function D(){var I,J,ie,U,R;if(y(null),w(!1),typeof window<"u"&&!window.isSecureContext&&window.location.hostname!=="localhost"&&window.location.hostname!=="127.0.0.1"){y("Camera access requires HTTPS or localhost. If connecting across a local network IP (e.g. 192.168.x.x), modern browsers disable camera access for insecure HTTP.");return}const $=((J=(I=navigator.mediaDevices)==null?void 0:I.getUserMedia)==null?void 0:J.bind(navigator.mediaDevices))||((ie=navigator.getUserMedia)==null?void 0:ie.bind(navigator))||((U=navigator.webkitGetUserMedia)==null?void 0:U.bind(navigator))||((R=navigator.mozGetUserMedia)==null?void 0:R.bind(navigator));if(!$){y(window.isSecureContext?"Camera access is not supported by your browser or environment.":"Camera access is blocked because the page is not served over a secure origin (HTTPS or localhost/127.0.0.1).");return}try{let Q;const fe=await Promise.race([$({video:{facingMode:"environment",width:{ideal:1280},height:{ideal:720}}}),new Promise((B,ne)=>{Q=window.setTimeout(()=>ne(new DOMException("Camera did not start in time","TimeoutError")),Gk)})]).finally(()=>{Q!==void 0&&window.clearTimeout(Q)});if(!L){fe.getTracks().forEach(B=>B.stop());return}f.current=fe,u.current&&(u.current.srcObject=fe,await u.current.play()),"BarcodeDetector"in window?T():S()}catch(Q){if(!L)return;console.error("Camera access error:",Q),y(Q.name==="NotAllowedError"||Q.name==="PermissionDeniedError"?"Camera permission denied. Please allow camera access in your browser settings.":Q.name==="TimeoutError"?"The camera did not start in time. On macOS, camera capture needs the packaged desktop app — a bare Python process cannot access the camera. Alternatively, open ProFiles in Chrome, Edge or Safari.":`Could not access camera: ${Q.message||"Unknown error"}`)}}return D(),()=>{L=!1,v()}},[n]);const S=()=>{w(!0),p.current=Yk({capture:()=>u.current?Vk(u.current):null,decode:L=>y2({imageBase64:L,formats:[...Bk]})},{onDetected:L=>{v(),a(L)},onError:L=>{v(),y(L)}})},T=()=>{const L=["qr_code","code_128","code_39","ean_13","ean_8","upc_a","upc_e","data_matrix"];let D;try{D=new window.BarcodeDetector({formats:L})}catch(I){console.warn("BarcodeDetector formats unsupported:",I),D=new window.BarcodeDetector}const $=async()=>{if(!u.current||u.current.readyState<2){m.current=requestAnimationFrame($);return}try{const I=await D.detect(u.current);if(I&&I.length>0){const J=I[0].rawValue;if(J){v(),a(J);return}}}catch(I){console.debug("Frame detection error:",I)}m.current=requestAnimationFrame($)};m.current=requestAnimationFrame($)};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/70 p-4 backdrop-blur-sm",onClick:r,children:h.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-label":"Camera barcode scanner",onKeyDown:d,className:"relative w-full max-w-lg rounded-2xl border border-frame-line glass-panel p-6 flex flex-col",onClick:L=>L.stopPropagation(),children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink",children:[h.jsx(Xy,{className:"h-5 w-5 text-chip-indigo-text"}),h.jsx("span",{children:"Scan with Camera"})]}),h.jsx("button",{onClick:r,className:"focus-ring rounded-lg p-1 text-ink-muted hover:bg-elevated hover:text-ink transition-colors","aria-label":"Close",children:h.jsx(nl,{className:"h-4 w-4"})})]}),x?h.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[h.jsx("div",{className:"rounded-full bg-status-danger-bg p-3 text-status-danger-text mb-3",children:h.jsx(lu,{className:"h-6 w-6"})}),h.jsx("p",{className:"text-xs text-status-danger-text max-w-xs",children:x}),h.jsx("button",{onClick:r,className:"btn btn-secondary mt-6 px-4 py-2",children:"Close"})]}):h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsxs("div",{className:"relative aspect-video w-full overflow-hidden rounded-xl bg-black border border-line flex items-center justify-center",children:[h.jsx("video",{ref:u,playsInline:!0,muted:!0,className:"h-full w-full object-cover"}),h.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:h.jsxs("div",{className:"relative h-48 w-48 rounded-lg border-2 border-dashed border-indigo-400/80 bg-indigo-500/5 shadow-[0_0_0_9999px_rgba(0,0,0,0.45)]",children:[h.jsx("div",{className:"absolute top-0 left-0 h-4 w-4 border-t-2 border-l-2 border-indigo-400"}),h.jsx("div",{className:"absolute top-0 right-0 h-4 w-4 border-t-2 border-r-2 border-indigo-400"}),h.jsx("div",{className:"absolute bottom-0 left-0 h-4 w-4 border-b-2 border-l-2 border-indigo-400"}),h.jsx("div",{className:"absolute bottom-0 right-0 h-4 w-4 border-b-2 border-r-2 border-indigo-400"})]})})]}),h.jsx("p",{className:"mt-4 text-center text-xs text-ink-muted",children:g?"Hold a QR code or barcode steady in front of your camera — frames are decoded by the local ProFiles server (no native Barcode Detector in this browser).":"Hold a QR code or barcode steady in front of your camera to auto-scan."})]})]})}):null}function Xk({isOpen:n,file:r,onConfirm:a,onDismiss:u}){const s=_.useRef(null);return _.useEffect(()=>{var d;if(n){const f=m=>{m.key==="Enter"?(m.preventDefault(),a()):m.key==="Escape"&&(m.preventDefault(),u())};return window.addEventListener("keydown",f),(d=s.current)==null||d.focus(),()=>window.removeEventListener("keydown",f)}},[n,a,u]),!n||!r?null:h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",onClick:u,children:h.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":`1 file matched: ${r.filename}`,className:"animate-modal-in w-full max-w-sm rounded-xl border border-frame-line glass-panel p-5 flex flex-col gap-4",onClick:d=>d.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink text-sm",children:[r.has_hook?h.jsx(tk,{className:"h-4 w-4 text-chip-purple-text"}):h.jsx(er,{className:"h-4 w-4 text-status-success-text"}),h.jsx("span",{children:"1 File Matched"})]}),h.jsx("button",{onClick:u,className:"focus-ring rounded p-1 text-ink-muted hover:bg-elevated hover:text-ink","aria-label":"Dismiss",children:h.jsx(nl,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-line bg-elevated/50 p-3",children:[h.jsx(Pr,{className:"h-5 w-5 text-chip-indigo-text shrink-0 mt-0.5"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("h4",{className:"text-xs font-semibold text-ink truncate",children:r.filename}),h.jsx("p",{className:"text-[11px] text-ink-muted truncate mt-0.5",children:r.rel_path||r.path}),r.has_hook&&h.jsx("span",{className:"inline-block mt-1 text-[10px] text-chip-purple-text bg-chip-purple-bg px-1.5 py-0.5 rounded border border-chip-purple-border/50 font-medium",children:"Workflow Hook Configured"})]})]}),h.jsx("p",{className:"text-xs text-ink-muted text-center",children:"Launch this file now?"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{type:"button",onClick:u,className:"btn btn-secondary flex-1 px-3 py-1.5",children:"Dismiss (Esc)"}),h.jsxs("button",{ref:s,type:"button",onClick:a,className:"btn btn-primary flex-1 px-3 py-1.5 shadow-md",children:[h.jsx(er,{className:"h-3 w-3 fill-current"}),"Launch (Enter)"]})]})]})})}function Ik({systemInfo:n,fileCount:r,theme:a,onToggleTheme:u,onOpenLog:s,onOpenConfig:d,onLoadConfig:f,onShowShortcuts:m,onReloadConfig:p,onExport:x,exportDisabled:y=!1,language:g="en",onLanguageChange:w,activeConfigName:v,lanEnabled:S,onToggleLan:T}){return h.jsxs("footer",{className:"flex items-center justify-between border-t border-line bg-app px-4 py-2 text-[11px] text-ink-muted transition-colors duration-200",children:[h.jsx("div",{className:"flex items-center gap-4",children:n&&h.jsxs("div",{className:"flex items-center gap-1.5 rounded-full border border-line bg-surface px-2.5 py-0.5 text-ink-secondary",children:[h.jsx(D2,{className:"h-3 w-3 text-status-success-text"}),h.jsx("a",{href:`http://${n.hostname}:${window.location.port}`,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ProFiles on ${n.hostname}`,className:"font-mono hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 rounded px-1 py-0.5",children:n.hostname}),h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsx("a",{href:`http://${n.ip}:${window.location.port}`,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ProFiles on ${n.ip}`,className:"font-mono hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 rounded px-1 py-0.5",children:n.ip}),h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsxs("span",{className:"flex items-center gap-1",title:"Session user",children:[h.jsx(Pw,{className:"h-3 w-3 text-ink-faint"}),h.jsx("span",{children:n.username||"operator"})]}),T!==void 0&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsx(He,{text:"LAN access",block:!1,children:h.jsxs("button",{onClick:()=>T(S!==!0),disabled:S===null,"aria-pressed":S===!0,className:`focus-ring flex items-center gap-1 rounded px-1 py-0.5 text-[10px] ${S===null?"text-ink-faint cursor-not-allowed":S===!0?"text-status-success-text":"text-ink-muted hover:text-ink"}`,children:[h.jsx(Ow,{className:"h-3 w-3"}),h.jsx("span",{children:"LAN"})]})})]})]})}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("span",{children:[h.jsx("strong",{className:"text-ink",children:r})," files found"]}),h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsx(He,{text:"Keyboard shortcuts (?)",block:!1,children:h.jsxs("button",{onClick:m,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Zy,{className:"h-3 w-3"}),h.jsx("span",{children:"Shortcuts"})]})}),h.jsx(He,{text:"Open the application log viewer",block:!1,children:h.jsxs("button",{onClick:s,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Pr,{className:"h-3 w-3"}),h.jsx("span",{children:"Logs"})]})}),h.jsx("span",{className:"text-ink-faint",children:"|"}),p&&h.jsx(He,{text:"Reload configuration from disk",block:!1,children:h.jsxs("button",{onClick:p,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(cs,{className:"h-3 w-3"}),h.jsx("span",{children:"Reload"})]})}),x&&h.jsx(He,{text:"Export the current results as CSV",block:!1,children:h.jsxs("button",{onClick:x,disabled:y,className:"focus-ring flex items-center gap-1 rounded text-ink-muted hover:text-ink disabled:opacity-40 disabled:hover:text-ink-muted",children:[h.jsx(Iy,{className:"h-3 w-3"}),h.jsx("span",{children:"Export CSV"})]})}),w&&h.jsxs("div",{className:"flex items-center overflow-hidden rounded border border-line text-[10px]",children:[h.jsx(He,{text:"English",block:!1,children:h.jsxs("button",{onClick:()=>w("en"),className:`flex items-center gap-1 px-1.5 py-0.5 transition-colors ${g==="en"?"bg-indigo-600 text-white focus-ring":"text-ink-muted hover:text-ink focus-ring"}`,children:[h.jsx(ww,{className:"h-3 w-3"}),h.jsx("span",{children:"EN"})]})}),h.jsx(He,{text:"Français",block:!1,children:h.jsx("button",{onClick:()=>w("fr"),className:`flex items-center gap-1 px-1.5 py-0.5 transition-colors ${g==="fr"?"bg-indigo-600 text-white focus-ring":"text-ink-muted hover:text-ink focus-ring"}`,children:h.jsx("span",{children:"FR"})})})]}),f&&h.jsx(He,{text:v?`Load a different .profiles file (active: ${v})`:"Load a .profiles file",block:!1,children:h.jsxs("button",{onClick:f,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Kr,{className:"h-3 w-3"}),h.jsx("span",{children:"Load config…"})]})}),h.jsx(He,{text:"Open configuration file",block:!1,children:h.jsxs("button",{onClick:d,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Gw,{className:"h-3 w-3"}),h.jsx("span",{children:"Config"})]})}),h.jsx(He,{text:`Switch to ${a==="dark"?"light":"dark"} mode`,block:!1,children:h.jsxs("button",{onClick:u,className:"focus-ring flex items-center gap-1 rounded px-1.5 py-0.5 text-ink-muted hover:bg-elevated hover:text-status-warning-text",children:[a==="dark"?h.jsx(Xw,{className:"h-3 w-3 text-status-warning-text"}):h.jsx(Dw,{className:"h-3 w-3 text-chip-indigo-text"}),h.jsx("span",{children:a==="dark"?"Light":"Dark"})]})})]})]})}const Kk=[{label:"5 seconds",seconds:5},{label:"10 seconds",seconds:10},{label:"30 seconds",seconds:30},{label:"1 minute",seconds:60},{label:"5 minutes",seconds:300}];function Zk({isOpen:n,currentInterval:r,onClose:a,onSetInterval:u}){const s=_.useRef(null),d=Wr({isOpen:n,onClose:a,dialogRef:s});if(!n)return null;const f=r>0,m=y=>{u(y)},p=y=>{y.preventDefault();const w=y.currentTarget.elements.namedItem("custom-interval"),v=parseInt(w.value,10);!isNaN(v)&&v>0&&u(v)},x=()=>{u(0)};return h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",children:h.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-label":"Auto-Rescan Timer",onKeyDown:d,className:"animate-modal-in w-[420px] max-w-full rounded-2xl border border-frame-line glass-panel p-5",children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink",children:[h.jsx(Jy,{className:"h-5 w-5 text-chip-indigo-text"}),h.jsx("span",{children:"Auto-Rescan Timer"})]}),h.jsx("button",{onClick:a,className:"focus-ring rounded-lg p-1 text-ink-muted hover:bg-elevated hover:text-ink",children:h.jsx(nl,{className:"h-4 w-4"})})]}),h.jsx("div",{className:"mb-4 rounded-lg bg-elevated/50 px-3 py-2 text-xs",children:f?h.jsxs("div",{className:"flex items-center gap-2 text-status-success-text",children:[h.jsx(tw,{className:"h-4 w-4 animate-pulse"}),h.jsxs("span",{children:["Auto-rescan every ",r,"s"]})]}):h.jsxs("div",{className:"flex items-center gap-2 text-ink-secondary",children:[h.jsx(W2,{className:"h-4 w-4"}),h.jsx("span",{children:"Auto-rescan is disabled"})]})}),h.jsxs("div",{className:"mb-4 space-y-1 text-xs",children:[h.jsx("p",{className:"text-ink-muted",children:"Presets:"}),h.jsx("div",{className:"grid grid-cols-2 gap-2",children:Kk.map(y=>h.jsx("button",{onClick:()=>m(y.seconds),className:"rounded-lg border border-line bg-elevated/50 px-3 py-1.5 text-left font-medium text-ink-secondary hover:border-chip-indigo-border hover:bg-chip-indigo-bg/40 hover:text-chip-indigo-text focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:y.label},y.seconds))})]}),h.jsxs("form",{onSubmit:p,className:"mb-4",children:[h.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-ink-secondary",children:[h.jsx(iw,{className:"h-3.5 w-3.5"}),h.jsx("span",{children:"Custom interval (seconds):"})]}),h.jsxs("div",{className:"mt-1 flex gap-2",children:[h.jsx("input",{type:"number",name:"custom-interval",min:"1",placeholder:"e.g. 45",className:"flex-1 rounded-lg border border-line bg-app px-2 py-1 text-xs text-ink placeholder-ink-faint focus:border-indigo-500 focus:outline-none"}),h.jsx("button",{type:"submit",className:"btn btn-primary rounded-lg px-3 py-1 font-semibold",children:"Set"})]})]}),f&&h.jsx("button",{onClick:x,className:"btn w-full rounded-lg border-line bg-elevated/50 px-3 py-2 text-status-warning-text hover:border-status-warning-border hover:bg-status-warning-bg/40",children:"Stop Auto-Rescan"}),h.jsx("div",{className:"flex justify-end gap-2 border-t border-line pt-3",children:h.jsx("button",{onClick:a,className:"rounded-lg border border-line bg-elevated px-4 py-2 text-xs font-semibold text-ink-secondary hover:bg-elevated/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:"Close"})})]})})}function $k(n,r){const a={};return(n[n.length-1]===""?[...n,""]:n).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const Jk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Wk={};function Xx(n,r){return(Wk.jsx?Pk:Jk).test(n)}const eS=/[ \t\n\f\r]/g;function tS(n){return typeof n=="object"?n.type==="text"?Ix(n.value):!1:Ix(n)}function Ix(n){return n.replace(eS,"")===""}class ou{constructor(r,a,u){this.normal=a,this.property=r,u&&(this.space=u)}}ou.prototype.normal={};ou.prototype.property={};ou.prototype.space=void 0;function ib(n,r){const a={},u={};for(const s of n)Object.assign(a,s.property),Object.assign(u,s.normal);return new ou(a,u,r)}function Nd(n){return n.toLowerCase()}class yn{constructor(r,a){this.attribute=a,this.property=r}}yn.prototype.attribute="";yn.prototype.booleanish=!1;yn.prototype.boolean=!1;yn.prototype.commaOrSpaceSeparated=!1;yn.prototype.commaSeparated=!1;yn.prototype.defined=!1;yn.prototype.mustUseProperty=!1;yn.prototype.number=!1;yn.prototype.overloadedBoolean=!1;yn.prototype.property="";yn.prototype.spaceSeparated=!1;yn.prototype.space=void 0;let nS=0;const De=nr(),Ot=nr(),Ed=nr(),ce=nr(),ht=nr(),Pi=nr(),_n=nr();function nr(){return 2**++nS}const jd=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:Ot,commaOrSpaceSeparated:_n,commaSeparated:Pi,number:ce,overloadedBoolean:Ed,spaceSeparated:ht},Symbol.toStringTag,{value:"Module"})),nd=Object.keys(jd);class Qd extends yn{constructor(r,a,u,s){let d=-1;if(super(r,a),Kx(this,"space",s),typeof u=="number")for(;++d4&&a.slice(0,4)==="data"&&uS.test(r)){if(r.charAt(4)==="-"){const d=r.slice(5).replace(Zx,cS);u="data"+d.charAt(0).toUpperCase()+d.slice(1)}else{const d=r.slice(4);if(!Zx.test(d)){let f=d.replace(aS,sS);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}s=Qd}return new s(u,r)}function sS(n){return"-"+n.toLowerCase()}function cS(n){return n.charAt(1).toUpperCase()}const fS=ib([rb,lS,ob,sb,cb],"html"),Xd=ib([rb,iS,ob,sb,cb],"svg");function dS(n){return n.join(" ").trim()}var $x=/\/\*(?:[^*]|\*(?!\/))*\*\//g,hS=/\n/g,mS=/^\s*/,pS=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,gS=/^:\s*/,xS=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,yS=/^[;\s]*/,bS=` +`,Jx="/",Px="*",Pa="",vS="comment",wS="declaration";function kS(n,r){if(typeof n!="string")throw new TypeError("First argument must be a string");if(!n)return[];r=r||{};var a=1,u=1;function s(S){var T=S.match(hS);T&&(a+=T.length);var L=S.lastIndexOf(bS);u=~L?S.length-L:u+S.length}function d(){var S={line:a,column:u};return function(T){return T.position=new f(S),x(),T}}function f(S){this.start=S,this.end={line:a,column:u},this.source=r.source}f.prototype.content=n;function m(S){var T=new Error(r.source+":"+a+":"+u+": "+S);if(T.reason=S,T.filename=r.source,T.line=a,T.column=u,T.source=n,!r.silent)throw T}function p(S){var T=S.exec(n);if(T){var L=T[0];return s(L),n=n.slice(L.length),T}}function x(){p(mS)}function y(S){for(var T;T=g();)S.push(T);return S}function g(){var S=d();if(!(Jx!=n.charAt(0)||Px!=n.charAt(1))){for(var T=2;Pa!=n.charAt(T)&&(Px!=n.charAt(T)||Jx!=n.charAt(T+1));)++T;if(T+=2,Pa===n.charAt(T-1))return m("End of comment missing");var L=n.slice(2,T-2);return u+=2,s(L),n=n.slice(T),u+=2,S({type:vS,comment:L})}}function w(){var S=d(),T=p(pS);if(T){if(g(),!p(gS))return m("property missing ':'");var L=p(xS),D=S({type:wS,property:T[0].replace($x,Pa).trim(),value:L?L[0].replace($x,Pa).trim():Pa});return p(yS),D}}function v(){var S=[];y(S);for(var T;T=w();)S.push(T),y(S);return S}return x(),v()}function SS(n,r){let a=null;if(!n||typeof n!="string")return a;const u=kS(n),s=typeof r=="function";return u.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:m}=d;s?r(f,m,d):m&&(a=a??{},a[f]=m)}),a}const fb=db("end"),Id=db("start");function db(n){return r;function r(a){const u=a&&a.position&&a.position[n]||{};if(typeof u.line=="number"&&u.line>0&&typeof u.column=="number"&&u.column>0)return{line:u.line,column:u.column,offset:typeof u.offset=="number"&&u.offset>-1?u.offset:void 0}}}function NS(n){const r=Id(n),a=fb(n);if(r&&a)return{start:r,end:a}}function iu(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?Wx(n.position):"start"in n||"end"in n?Wx(n):"line"in n||"column"in n?Cd(n):""}function Cd(n){return ey(n&&n.line)+":"+ey(n&&n.column)}function Wx(n){return Cd(n&&n.start)+"-"+Cd(n&&n.end)}function ey(n){return n&&typeof n=="number"?n:1}class an extends Error{constructor(r,a,u){super(),typeof a=="string"&&(u=a,a=void 0);let s="",d={},f=!1;if(a&&("line"in a&&"column"in a?d={place:a}:"start"in a&&"end"in a?d={place:a}:"type"in a?d={ancestors:[a],place:a.position}:d={...a}),typeof r=="string"?s=r:!d.cause&&r&&(f=!0,s=r.message,d.cause=r),!d.ruleId&&!d.source&&typeof u=="string"){const p=u.indexOf(":");p===-1?d.ruleId=u:(d.source=u.slice(0,p),d.ruleId=u.slice(p+1))}if(!d.place&&d.ancestors&&d.ancestors){const p=d.ancestors[d.ancestors.length-1];p&&(d.place=p.position)}const m=d.place&&"start"in d.place?d.place.start:d.place;this.ancestors=d.ancestors||void 0,this.cause=d.cause||void 0,this.column=m?m.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=m?m.line:void 0,this.name=iu(d.place)||"1:1",this.place=d.place||void 0,this.reason=this.message,this.ruleId=d.ruleId||void 0,this.source=d.source||void 0,this.stack=f&&d.cause&&typeof d.cause.stack=="string"?d.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}an.prototype.file="";an.prototype.name="";an.prototype.reason="";an.prototype.message="";an.prototype.stack="";an.prototype.column=void 0;an.prototype.line=void 0;an.prototype.ancestors=void 0;an.prototype.cause=void 0;an.prototype.fatal=void 0;an.prototype.place=void 0;an.prototype.ruleId=void 0;an.prototype.source=void 0;const Kd={}.hasOwnProperty,ES=new Map,jS=/[A-Z]/g,CS=/-([a-z])/g,TS=new Set(["table","tbody","thead","tfoot","tr"]),_S=new Set(["td","th"]),hb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function AS(n,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=r.filePath||void 0;let u;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");u=BS(a,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");u=US(a,r.jsx,r.jsxs)}const s={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:u,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?Xd:fS,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},d=mb(s,n,void 0);return d&&typeof d!="string"?d:s.create(n,s.Fragment,{children:d||void 0},void 0)}function mb(n,r,a){if(r.type==="element")return zS(n,r,a);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return DS(n,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return OS(n,r,a);if(r.type==="mdxjsEsm")return MS(n,r);if(r.type==="root")return RS(n,r,a);if(r.type==="text")return LS(n,r)}function zS(n,r,a){const u=n.schema;let s=u;r.tagName.toLowerCase()==="svg"&&u.space==="html"&&(s=Xd,n.schema=s),n.ancestors.push(r);const d=gb(n,r.tagName,!1),f=HS(n,r);let m=$d(n,r);return TS.has(r.tagName)&&(m=m.filter(function(p){return typeof p=="string"?!tS(p):!0})),pb(n,f,d,r),Zd(f,m),n.ancestors.pop(),n.schema=u,n.create(r,d,f,a)}function DS(n,r){if(r.data&&r.data.estree&&n.evaluater){const u=r.data.estree.body[0];return u.type,n.evaluater.evaluateExpression(u.expression)}uu(n,r.position)}function MS(n,r){if(r.data&&r.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(r.data.estree);uu(n,r.position)}function OS(n,r,a){const u=n.schema;let s=u;r.name==="svg"&&u.space==="html"&&(s=Xd,n.schema=s),n.ancestors.push(r);const d=r.name===null?n.Fragment:gb(n,r.name,!0),f=qS(n,r),m=$d(n,r);return pb(n,f,d,r),Zd(f,m),n.ancestors.pop(),n.schema=u,n.create(r,d,f,a)}function RS(n,r,a){const u={};return Zd(u,$d(n,r)),n.create(r,n.Fragment,u,a)}function LS(n,r){return r.value}function pb(n,r,a,u){typeof a!="string"&&a!==n.Fragment&&n.passNode&&(r.node=u)}function Zd(n,r){if(r.length>0){const a=r.length>1?r:r[0];a&&(n.children=a)}}function US(n,r,a){return u;function u(s,d,f,m){const x=Array.isArray(f.children)?a:r;return m?x(d,f,m):x(d,f)}}function BS(n,r){return a;function a(u,s,d,f){const m=Array.isArray(d.children),p=Id(u);return r(s,d,f,m,{columnNumber:p?p.column-1:void 0,fileName:n,lineNumber:p?p.line:void 0},void 0)}}function HS(n,r){const a={};let u,s;for(s in r.properties)if(s!=="children"&&Kd.call(r.properties,s)){const d=FS(n,s,r.properties[s]);if(d){const[f,m]=d;n.tableCellAlignToStyle&&f==="align"&&typeof m=="string"&&_S.has(r.tagName)?u=m:a[f]=m}}if(u){const d=a.style||(a.style={});d[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=u}return a}function qS(n,r){const a={};for(const u of r.attributes)if(u.type==="mdxJsxExpressionAttribute")if(u.data&&u.data.estree&&n.evaluater){const d=u.data.estree.body[0];d.type;const f=d.expression;f.type;const m=f.properties[0];m.type,Object.assign(a,n.evaluater.evaluateExpression(m.argument))}else uu(n,r.position);else{const{name:s}=u;let d;if(u.value&&typeof u.value=="object")if(u.value.data&&u.value.data.estree&&n.evaluater){const m=u.value.data.estree.body[0];m.type,d=n.evaluater.evaluateExpression(m.expression)}else uu(n,r.position);else d=u.value===null?!0:u.value;a[s]=d}return a}function $d(n,r){const a=[];let u=-1;const s=n.passKeys?new Map:ES;for(;++us?0:s+r:r=r>s?s:r,a=a>0?a:0,u.length<1e4)f=Array.from(u),f.unshift(r,a),n.splice(...f);else for(a&&n.splice(r,a);d0?(el(n,n.length,0,r),n):r}const ly={}.hasOwnProperty;function yb(n){const r={};let a=-1;for(;++a13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function tl(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Pt=ki(/[A-Za-z]/),Wt=ki(/[\dA-Za-z]/),JS=ki(/[#-'*+\--9=?A-Z^-~]/);function is(n){return n!==null&&(n<32||n===127)}const Td=ki(/\d/),PS=ki(/[\dA-Fa-f]/),vb=ki(/[!-/:-@[-`{-~]/);function Te(n){return n!==null&&n<-2}function mt(n){return n!==null&&(n<0||n===32)}function Ve(n){return n===-2||n===-1||n===32}const fs=ki(new RegExp("\\p{P}|\\p{S}","u")),tr=ki(/\s/);function ki(n){return r;function r(a){return a!==null&&a>-1&&n.test(String.fromCharCode(a))}}function ta(n){const r=[];let a=-1,u=0,s=0;for(;++a55295&&d<57344){const m=n.charCodeAt(a+1);d<56320&&m>56319&&m<57344?(f=String.fromCharCode(d,m),s=1):f="�"}else f=String.fromCharCode(d);f&&(r.push(n.slice(u,a),encodeURIComponent(f)),u=a+s+1,f=""),s&&(a+=s,s=0)}return r.join("")+n.slice(u)}function et(n,r,a,u){const s=u?u-1:1/0;let d=0;return f;function f(p){return Ve(p)?(n.enter(a),m(p)):r(p)}function m(p){return Ve(p)&&d++=s?r(y):a(y)}}const WS={tokenize:eN};function eN(n){const r=n.attempt(this.parser.constructs.contentInitial,u,s);let a;return r;function u(m){if(m===null){n.consume(m);return}return n.enter("lineEnding"),n.consume(m),n.exit("lineEnding"),et(n,r,"linePrefix")}function s(m){return n.enter("paragraph"),d(m)}function d(m){const p=n.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=p),a=p,f(m)}function f(m){if(m===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(m);return}return Te(m)?(n.consume(m),n.exit("chunkText"),d):(n.consume(m),f)}}let rs=class{constructor(){this.index=new Map,this.map=[]}add(r,a,u){iy(this,r,a,u,!1)}addBefore(r,a,u){iy(this,r,a,u,!0)}consume(r){if(this.map.sort(function(d,f){return d[0]-f[0]}),this.map.length===0)return;let a=this.map.length;const u=[];for(;a>0;)a-=1,u.push(r.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),r.length=this.map[a][0];u.push(r.slice()),r.length=0;let s=u.pop();for(;s;){for(const d of s)r.push(d);s=u.pop()}this.map.length=0,this.index.clear()}};function iy(n,r,a,u,s){if(a===0&&u.length===0)return;const d=n.index.get(r);if(d){d[1]+=a,s?(u.push(...d[2]),d[2]=u):d[2].push(...u);return}const f=[r,a,u];n.map.push(f),n.index.set(r,f)}const tN={tokenize:nN},ry={tokenize:lN};function nN(n){const r=this,a=[];let u=0,s,d,f;return m;function m(I){if(uf))return;const R=r.events.length;let Q=R,fe,B;for(;Q--;)if(r.events[Q][0]==="exit"&&r.events[Q][1].type==="chunkFlow"){if(fe){B=r.events[Q][1].end;break}fe=!0}for(D(u),U=R;UI;){const ie=a[J];r.containerState=ie[1],ie[0].exit.call(r,n)}a.length=I}function $(){s.write([null]),d=void 0,s=void 0,r.containerState._closeFlow=void 0}}function lN(n,r,a){return et(n,n.attempt(this.parser.constructs.document,r,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wi(n){if(n===null||mt(n)||tr(n))return 1;if(fs(n))return 2}function ds(n,r,a){const u=[];let s=-1;for(;++s1&&n[a][1].end.offset-n[a][1].start.offset>1?2:1,f={...n[s][1].end},m={...n[a][1].start};ay(f,-d),ay(m,d);const p={type:d>1?"strongSequence":"emphasisSequence",start:f,end:{...n[s][1].end}},x={type:d>1?"strongSequence":"emphasisSequence",start:{...n[a][1].start},end:m},y={type:d>1?"strongText":"emphasisText",start:{...n[s][1].end},end:{...n[a][1].start}},g={type:d>1?"strong":"emphasis",start:{...p.start},end:{...x.end}};n[s][1].end={...p.start},n[a][1].start={...x.end},u=[],n[s][1].end.offset-n[s][1].start.offset&&(u=Yn(u,[["enter",n[s][1],r],["exit",n[s][1],r]])),u=Yn(u,[["enter",g,r],["enter",p,r],["exit",p,r],["enter",y,r]]),u=Yn(u,ds(r.parser.constructs.insideSpan.null,n.slice(s+1,a),r)),u=Yn(u,[["exit",y,r],["enter",x,r],["exit",x,r],["exit",g,r]]);let w=0;n[a][1].end.offset-n[a][1].start.offset&&(w=2,u=Yn(u,[["enter",n[a][1],r],["exit",n[a][1],r]])),el(n,s-1,a-s+3,u),a=s+u.length-w-2;break}}for(a=-1;++a0&&Ve(U)?et(n,$,"linePrefix",d+1)(U):$(U)}function $(U){return U===null||Te(U)?n.check(Ad,T,J)(U):(n.enter("codeFlowValue"),I(U))}function I(U){return U===null||Te(U)?(n.exit("codeFlowValue"),$(U)):(n.consume(U),I)}function J(U){return n.exit("codeFenced"),r(U)}function ie(U,R,Q){let fe=0;return B;function B(ae){return U.enter("lineEnding"),U.consume(ae),U.exit("lineEnding"),ne}function ne(ae){return U.enter("codeFencedFence"),Ve(ae)?et(U,V,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ae):V(ae)}function V(ae){return ae===m?(U.enter("codeFencedFenceSequence"),se(ae)):Q(ae)}function se(ae){return ae===m?(fe++,U.consume(ae),se):fe>=f?(U.exit("codeFencedFenceSequence"),Ve(ae)?et(U,ve,"whitespace")(ae):ve(ae)):Q(ae)}function ve(ae){return ae===null||Te(ae)?(U.exit("codeFencedFence"),R(ae)):Q(ae)}}}const id={name:"codeIndented",tokenize:xN},gN={partial:!0,tokenize:yN};function xN(n,r,a){return u;function u(m){return n.enter("codeIndented"),wb(n,s,a,"linePrefix",4,4)(m)}function s(m){return m===null?f(m):Te(m)?n.attempt(gN,s,f)(m):(n.enter("codeFlowValue"),d(m))}function d(m){return m===null||Te(m)?(n.exit("codeFlowValue"),s(m)):(n.consume(m),d)}function f(m){return n.exit("codeIndented"),r(m)}}function yN(n,r,a){const u=this;return s;function s(f){return u.parser.lazy[u.now().line]?a(f):Te(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),s):wb(n,r,d,"linePrefix",4,4)(f)}function d(f){return Te(f)?s(f):a(f)}}const bN={name:"codeText",previous:wN,resolve:vN,tokenize:kN};function vN(n){let r=n.length-4,a=3,u,s;if((n[a][1].type==="lineEnding"||n[a][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(u=a;++u=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return rthis.left.length?this.right.slice(this.right.length-u+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-u+this.left.length).reverse())}splice(r,a,u){const s=a||0;this.setCursor(Math.trunc(r));const d=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return u&&Wa(this.left,u),d.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),Wa(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Wa(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r=4?r(f):n.interrupt(u.parser.constructs.flow,a,r)(f)}}function jb(n,r,a,u,s,d,f,m,p){const x=p||Number.POSITIVE_INFINITY;let y=0;return g;function g(D){return D===60?(n.enter(u),n.enter(s),n.enter(d),n.consume(D),n.exit(d),w):D===null||D===32||D===41||is(D)?a(D):(n.enter(u),n.enter(f),n.enter(m),n.enter("chunkString",{contentType:"string"}),T(D))}function w(D){return D===62?(n.enter(d),n.consume(D),n.exit(d),n.exit(s),n.exit(u),r):(n.enter(m),n.enter("chunkString",{contentType:"string"}),v(D))}function v(D){return D===62?(n.exit("chunkString"),n.exit(m),w(D)):D===null||D===60||Te(D)?a(D):(n.consume(D),D===92?S:v)}function S(D){return D===60||D===62||D===92?(n.consume(D),v):v(D)}function T(D){return!y&&(D===null||D===41||mt(D))?(n.exit("chunkString"),n.exit(m),n.exit(f),n.exit(u),r(D)):y999||v===null||v===91||v===93&&!p||v===94&&!m&&"_hiddenFootnoteSupport"in f.parser.constructs?a(v):v===93?(n.exit(d),n.enter(s),n.consume(v),n.exit(s),n.exit(u),r):Te(v)?(n.enter("lineEnding"),n.consume(v),n.exit("lineEnding"),y):(n.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||v===91||v===93||Te(v)||m++>999?(n.exit("chunkString"),y(v)):(n.consume(v),p||(p=!Ve(v)),v===92?w:g)}function w(v){return v===91||v===92||v===93?(n.consume(v),m++,g):g(v)}}function Tb(n,r,a,u,s,d){let f;return m;function m(w){return w===34||w===39||w===40?(n.enter(u),n.enter(s),n.consume(w),n.exit(s),f=w===40?41:w,p):a(w)}function p(w){return w===f?(n.enter(s),n.consume(w),n.exit(s),n.exit(u),r):(n.enter(d),x(w))}function x(w){return w===f?(n.exit(d),p(f)):w===null?a(w):Te(w)?(n.enter("lineEnding"),n.consume(w),n.exit("lineEnding"),et(n,x,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),y(w))}function y(w){return w===f||w===null||Te(w)?(n.exit("chunkString"),x(w)):(n.consume(w),w===92?g:y)}function g(w){return w===f||w===92?(n.consume(w),y):y(w)}}function ru(n,r){let a;return u;function u(s){return Te(s)?(n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),a=!0,u):Ve(s)?et(n,u,a?"linePrefix":"lineSuffix")(s):r(s)}}const AN={name:"definition",tokenize:DN},zN={partial:!0,tokenize:MN};function DN(n,r,a){const u=this;let s;return d;function d(v){return n.enter("definition"),f(v)}function f(v){return Cb.call(u,n,m,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function m(v){return s=tl(u.sliceSerialize(u.events[u.events.length-1][1]).slice(1,-1)),v===58?(n.enter("definitionMarker"),n.consume(v),n.exit("definitionMarker"),p):a(v)}function p(v){return mt(v)?ru(n,x)(v):x(v)}function x(v){return jb(n,y,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function y(v){return n.attempt(zN,g,g)(v)}function g(v){return Ve(v)?et(n,w,"whitespace")(v):w(v)}function w(v){return v===null||Te(v)?(n.exit("definition"),u.parser.defined.push(s),r(v)):a(v)}}function MN(n,r,a){return u;function u(m){return mt(m)?ru(n,s)(m):a(m)}function s(m){return Tb(n,d,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(m)}function d(m){return Ve(m)?et(n,f,"whitespace")(m):f(m)}function f(m){return m===null||Te(m)?r(m):a(m)}}const ON={name:"hardBreakEscape",tokenize:RN};function RN(n,r,a){return u;function u(d){return n.enter("hardBreakEscape"),n.consume(d),s}function s(d){return Te(d)?(n.exit("hardBreakEscape"),r(d)):a(d)}}const LN={name:"headingAtx",resolve:UN,tokenize:BN};function UN(n,r){let a=n.length-2,u=3;if(n[u][1].type==="whitespace"&&(u+=2),a-2>u&&n[a][1].type==="whitespace"&&(a-=2),n[a][1].type==="atxHeadingSequence"&&(u===a-1||a-4>u&&n[a-2][1].type==="whitespace")&&(a-=u+1===a?2:4),a>u){const s={type:"atxHeadingText",start:n[u][1].start,end:n[a][1].end},d={type:"chunkText",start:n[u][1].start,end:n[a][1].end,contentType:"text"};el(n,u,a-u+1,[["enter",s,r],["enter",d,r],["exit",d,r],["exit",s,r]])}return n}function BN(n,r,a){let u=0;return s;function s(y){return n.enter("atxHeading"),d(y)}function d(y){return n.enter("atxHeadingSequence"),f(y)}function f(y){return y===35&&u++<6?(n.consume(y),f):y===null||mt(y)?(n.exit("atxHeadingSequence"),m(y)):a(y)}function m(y){return y===35?(n.enter("atxHeadingSequence"),p(y)):y===null||Te(y)?(n.exit("atxHeading"),r(y)):Ve(y)?et(n,m,"whitespace")(y):(n.enter("atxHeadingText"),x(y))}function p(y){return y===35?(n.consume(y),p):(n.exit("atxHeadingSequence"),m(y))}function x(y){return y===null||y===35||mt(y)?(n.exit("atxHeadingText"),m(y)):(n.consume(y),x)}}const _b=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],zd=["pre","script","style","textarea"],HN={concrete:!0,name:"htmlFlow",resolveTo:FN,tokenize:VN},qN={partial:!0,tokenize:YN};function FN(n){let r=n.length;for(;r--&&!(n[r][0]==="enter"&&n[r][1].type==="htmlFlow"););return r>1&&n[r-2][1].type==="linePrefix"&&(n[r][1].start=n[r-2][1].start,n[r+1][1].start=n[r-2][1].start,n.splice(r-2,2)),n}function VN(n,r,a){const u=this;let s,d,f,m,p;return x;function x(M){return y(M)}function y(M){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(M),g}function g(M){return M===33?(n.consume(M),w):M===47?(n.consume(M),d=!0,T):M===63?(n.consume(M),s=3,u.interrupt?r:N):Pt(M)?(n.consume(M),f=String.fromCharCode(M),L):a(M)}function w(M){return M===45?(n.consume(M),s=2,v):M===91?(n.consume(M),s=5,m=0,S):Pt(M)?(n.consume(M),s=4,u.interrupt?r:N):a(M)}function v(M){return M===45?(n.consume(M),u.interrupt?r:N):a(M)}function S(M){const E="CDATA[";return M===E.charCodeAt(m++)?(n.consume(M),m===E.length?u.interrupt?r:V:S):a(M)}function T(M){return Pt(M)?(n.consume(M),f=String.fromCharCode(M),L):a(M)}function L(M){if(M===null||M===47||M===62||mt(M)){const E=M===47,Y=f.toLowerCase();return!E&&!d&&zd.includes(Y)?(s=1,u.interrupt?r(M):V(M)):_b.includes(f.toLowerCase())?(s=6,E?(n.consume(M),D):u.interrupt?r(M):V(M)):(s=7,u.interrupt&&!u.parser.lazy[u.now().line]?a(M):d?$(M):I(M))}return M===45||Wt(M)?(n.consume(M),f+=String.fromCharCode(M),L):a(M)}function D(M){return M===62?(n.consume(M),u.interrupt?r:V):a(M)}function $(M){return Ve(M)?(n.consume(M),$):B(M)}function I(M){return M===47?(n.consume(M),B):M===58||M===95||Pt(M)?(n.consume(M),J):Ve(M)?(n.consume(M),I):B(M)}function J(M){return M===45||M===46||M===58||M===95||Wt(M)?(n.consume(M),J):ie(M)}function ie(M){return M===61?(n.consume(M),U):Ve(M)?(n.consume(M),ie):I(M)}function U(M){return M===null||M===60||M===61||M===62||M===96?a(M):M===34||M===39?(n.consume(M),p=M,R):Ve(M)?(n.consume(M),U):Q(M)}function R(M){return M===p?(n.consume(M),p=null,fe):M===null||Te(M)?a(M):(n.consume(M),R)}function Q(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||mt(M)?ie(M):(n.consume(M),Q)}function fe(M){return M===47||M===62||Ve(M)?I(M):a(M)}function B(M){return M===62?(n.consume(M),ne):a(M)}function ne(M){return M===null||Te(M)?V(M):Ve(M)?(n.consume(M),ne):a(M)}function V(M){return M===45&&s===2?(n.consume(M),A):M===60&&s===1?(n.consume(M),W):M===62&&s===4?(n.consume(M),qe):M===63&&s===3?(n.consume(M),N):M===93&&s===5?(n.consume(M),re):Te(M)&&(s===6||s===7)?(n.exit("htmlFlowData"),n.check(qN,Ge,se)(M)):M===null||Te(M)?(n.exit("htmlFlowData"),se(M)):(n.consume(M),V)}function se(M){return n.check(Ad,ve,Ge)(M)}function ve(M){return n.enter("lineEnding"),n.consume(M),n.exit("lineEnding"),ae}function ae(M){return M===null||Te(M)?se(M):(n.enter("htmlFlowData"),V(M))}function A(M){return M===45?(n.consume(M),N):V(M)}function W(M){return M===47?(n.consume(M),f="",le):V(M)}function le(M){if(M===62){const E=f.toLowerCase();return zd.includes(E)?(n.consume(M),qe):V(M)}return Pt(M)&&f.length<8?(n.consume(M),f+=String.fromCharCode(M),le):V(M)}function re(M){return M===93?(n.consume(M),N):V(M)}function N(M){return M===62?(n.consume(M),qe):M===45&&s===2?(n.consume(M),N):V(M)}function qe(M){return M===null||Te(M)?(n.exit("htmlFlowData"),Ge(M)):(n.consume(M),qe)}function Ge(M){return n.exit("htmlFlow"),r(M)}}function YN(n,r,a){return u;function u(s){return n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),n.attempt(su,r,a)}}const GN={name:"htmlText",tokenize:QN};function QN(n,r,a){const u=this;let s,d,f;return m;function m(N){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(N),p}function p(N){return N===33?(n.consume(N),x):N===47?(n.consume(N),ie):N===63?(n.consume(N),I):Pt(N)?(n.consume(N),Q):a(N)}function x(N){return N===45?(n.consume(N),y):N===91?(n.consume(N),d=0,S):Pt(N)?(n.consume(N),$):a(N)}function y(N){return N===45?(n.consume(N),v):a(N)}function g(N){return N===null?a(N):N===45?(n.consume(N),w):Te(N)?(f=g,W(N)):(n.consume(N),g)}function w(N){return N===45?(n.consume(N),v):g(N)}function v(N){return N===62?A(N):N===45?w(N):g(N)}function S(N){const qe="CDATA[";return N===qe.charCodeAt(d++)?(n.consume(N),d===qe.length?T:S):a(N)}function T(N){return N===null?a(N):N===93?(n.consume(N),L):Te(N)?(f=T,W(N)):(n.consume(N),T)}function L(N){return N===93?(n.consume(N),D):T(N)}function D(N){return N===62?A(N):N===93?(n.consume(N),D):T(N)}function $(N){return N===null||N===62?A(N):Te(N)?(f=$,W(N)):(n.consume(N),$)}function I(N){return N===null?a(N):N===63?(n.consume(N),J):Te(N)?(f=I,W(N)):(n.consume(N),I)}function J(N){return N===62?A(N):I(N)}function ie(N){return Pt(N)?(n.consume(N),U):a(N)}function U(N){return N===45||Wt(N)?(n.consume(N),U):R(N)}function R(N){return Te(N)?(f=R,W(N)):Ve(N)?(n.consume(N),R):A(N)}function Q(N){return N===45||Wt(N)?(n.consume(N),Q):N===47||N===62||mt(N)?fe(N):a(N)}function fe(N){return N===47?(n.consume(N),A):N===58||N===95||Pt(N)?(n.consume(N),B):Te(N)?(f=fe,W(N)):Ve(N)?(n.consume(N),fe):A(N)}function B(N){return N===45||N===46||N===58||N===95||Wt(N)?(n.consume(N),B):ne(N)}function ne(N){return N===61?(n.consume(N),V):Te(N)?(f=ne,W(N)):Ve(N)?(n.consume(N),ne):fe(N)}function V(N){return N===null||N===60||N===61||N===62||N===96?a(N):N===34||N===39?(n.consume(N),s=N,se):Te(N)?(f=V,W(N)):Ve(N)?(n.consume(N),V):(n.consume(N),ve)}function se(N){return N===s?(n.consume(N),s=void 0,ae):N===null?a(N):Te(N)?(f=se,W(N)):(n.consume(N),se)}function ve(N){return N===null||N===34||N===39||N===60||N===61||N===96?a(N):N===47||N===62||mt(N)?fe(N):(n.consume(N),ve)}function ae(N){return N===47||N===62||mt(N)?fe(N):a(N)}function A(N){return N===62?(n.consume(N),n.exit("htmlTextData"),n.exit("htmlText"),r):a(N)}function W(N){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(N),n.exit("lineEnding"),le}function le(N){return Ve(N)?et(n,re,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):re(N)}function re(N){return n.enter("htmlTextData"),f(N)}}const Wd={name:"labelEnd",resolveAll:ZN,resolveTo:$N,tokenize:JN},XN={tokenize:PN},IN={tokenize:WN},KN={tokenize:e3};function ZN(n){let r=-1;const a=[];for(;++r0&&s[s.length-1]._balanced;)s.pop();d=s[s.length-1]}return m;function m(w){return d?d._inactive?g(w):(f=u.parser.defined.includes(tl(u.sliceSerialize({start:d.end,end:u.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(w),n.exit("labelMarker"),n.exit("labelEnd"),p):a(w)}function p(w){return w===40?n.attempt(XN,y,f?y:g)(w):w===91?n.attempt(IN,y,f?x:g)(w):f?y(w):g(w)}function x(w){return n.attempt(KN,y,g)(w)}function y(w){return s.pop(),r(w)}function g(w){return d._balanced=!0,a(w)}}function PN(n,r,a){return u;function u(g){return n.enter("resource"),n.enter("resourceMarker"),n.consume(g),n.exit("resourceMarker"),s}function s(g){return mt(g)?ru(n,d)(g):d(g)}function d(g){return g===41?y(g):jb(n,f,m,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function f(g){return mt(g)?ru(n,p)(g):y(g)}function m(g){return a(g)}function p(g){return g===34||g===39||g===40?Tb(n,x,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function x(g){return mt(g)?ru(n,y)(g):y(g)}function y(g){return g===41?(n.enter("resourceMarker"),n.consume(g),n.exit("resourceMarker"),n.exit("resource"),r):a(g)}}function WN(n,r,a){const u=this;return s;function s(m){return Cb.call(u,n,d,f,"reference","referenceMarker","referenceString")(m)}function d(m){return u.parser.defined.includes(tl(u.sliceSerialize(u.events[u.events.length-1][1]).slice(1,-1)))?r(m):a(m)}function f(m){return a(m)}}function e3(n,r,a){return u;function u(d){return n.enter("reference"),n.enter("referenceMarker"),n.consume(d),n.exit("referenceMarker"),s}function s(d){return d===93?(n.enter("referenceMarker"),n.consume(d),n.exit("referenceMarker"),n.exit("reference"),r):a(d)}}const t3={name:"labelStartImage",resolveAll:Wd.resolveAll,tokenize:n3};function n3(n,r,a){const u=this;let s;return d;function d(p){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(p),n.exit("labelImageMarker"),f}function f(p){return p===91?(n.enter("labelMarker"),n.consume(p),n.exit("labelMarker"),s=n.exit("labelImage"),m):a(p)}function m(p){return p===94&&"_hiddenFootnoteSupport"in u.parser.constructs?a(p):(u._labelStarts=u._labelStarts||[],u._labelStarts.push(s),r(p))}}const l3={name:"labelStartLink",resolveAll:Wd.resolveAll,tokenize:i3};function i3(n,r,a){const u=this;let s;return d;function d(m){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(m),n.exit("labelMarker"),s=n.exit("labelLink"),f}function f(m){return m===94&&"_hiddenFootnoteSupport"in u.parser.constructs?a(m):(u._labelStarts=u._labelStarts||[],u._labelStarts.push(s),r(m))}}const rd={name:"lineEnding",tokenize:r3};function r3(n,r){return a;function a(u){return n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),et(n,r,"linePrefix")}}const ts={name:"thematicBreak",tokenize:a3};function a3(n,r,a){let u=0,s;return d;function d(x){return n.enter("thematicBreak"),f(x)}function f(x){return s=x,m(x)}function m(x){return x===s?(n.enter("thematicBreakSequence"),p(x)):u>=3&&(x===null||Te(x))?(n.exit("thematicBreak"),r(x)):a(x)}function p(x){return x===s?(n.consume(x),u++,p):(n.exit("thematicBreakSequence"),Ve(x)?et(n,m,"whitespace")(x):m(x))}}const xn={continuation:{tokenize:c3},exit:d3,name:"list",tokenize:s3},u3={partial:!0,tokenize:h3},o3={partial:!0,tokenize:f3};function s3(n,r,a){const u=this,s=u.events[u.events.length-1];let d=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,f=0;return m;function m(v){const S=u.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!u.containerState.marker||v===u.containerState.marker:Td(v)){if(u.containerState.type||(u.containerState.type=S,n.enter(S,{_container:!0})),S==="listUnordered")return n.enter("listItemPrefix"),v===42||v===45?n.check(ts,a,x)(v):x(v);if(!u.interrupt||v===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),p(v)}return a(v)}function p(v){return Td(v)&&++f<10?(n.consume(v),p):(!u.interrupt||f<2)&&(u.containerState.marker?v===u.containerState.marker:v===41||v===46)?(n.exit("listItemValue"),x(v)):a(v)}function x(v){return n.enter("listItemMarker"),n.consume(v),n.exit("listItemMarker"),u.containerState.marker=u.containerState.marker||v,n.check(su,u.interrupt?a:y,n.attempt(u3,w,g))}function y(v){return u.containerState.initialBlankLine=!0,d++,w(v)}function g(v){return Ve(v)?(n.enter("listItemPrefixWhitespace"),n.consume(v),n.exit("listItemPrefixWhitespace"),w):a(v)}function w(v){return u.containerState.size=d+u.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(v)}}function c3(n,r,a){const u=this;return u.containerState._closeFlow=void 0,n.check(su,s,d);function s(m){return u.containerState.furtherBlankLines=u.containerState.furtherBlankLines||u.containerState.initialBlankLine,et(n,r,"listItemIndent",u.containerState.size+1)(m)}function d(m){return u.containerState.furtherBlankLines||!Ve(m)?(u.containerState.furtherBlankLines=void 0,u.containerState.initialBlankLine=void 0,f(m)):(u.containerState.furtherBlankLines=void 0,u.containerState.initialBlankLine=void 0,n.attempt(o3,r,f)(m))}function f(m){return u.containerState._closeFlow=!0,u.interrupt=void 0,et(n,n.attempt(xn,r,a),"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m)}}function f3(n,r,a){const u=this;return et(n,s,"listItemIndent",u.containerState.size+1);function s(d){const f=u.events[u.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===u.containerState.size?r(d):a(d)}}function d3(n){n.exit(this.containerState.type)}function h3(n,r,a){const u=this;return et(n,s,"listItemPrefixWhitespace",u.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(d){const f=u.events[u.events.length-1];return!Ve(d)&&f&&f[1].type==="listItemPrefixWhitespace"?r(d):a(d)}}const oy={name:"setextUnderline",resolveTo:m3,tokenize:p3};function m3(n,r){const a=new rs;let u=n.length,s,d,f;for(;u--;)if(n[u][0]==="enter"){if(n[u][1].type==="content"){s=u;break}n[u][1].type==="paragraph"&&(d=u)}else n[u][1].type==="content"&&a.add(u,1,[]),!f&&n[u][1].type==="definition"&&(f=u);const m={type:"setextHeading",start:{...n[s][1].start},end:{...n[n.length-1][1].end}};return n[d][1].type="setextHeadingText",f?(a.add(d,0,[["enter",m,r]]),a.add(f+1,0,[["exit",n[s][1],r]]),n[s][1].end={...n[f][1].end}):n[s][1]=m,a.add(n.length,0,[["exit",m,r]]),a.consume(n),n}function p3(n,r,a){const u=this;let s;return d;function d(x){let y=u.events.length,g;for(;y--;)if(u.events[y][1].type!=="lineEnding"&&u.events[y][1].type!=="linePrefix"&&u.events[y][1].type!=="content"){g=u.events[y][1].type==="paragraph";break}return!u.parser.lazy[u.now().line]&&(u.interrupt||g)?(n.enter("setextHeadingLine"),s=x,f(x)):a(x)}function f(x){return n.enter("setextHeadingLineSequence"),m(x)}function m(x){return x===s?(n.consume(x),m):(n.exit("setextHeadingLineSequence"),Ve(x)?et(n,p,"lineSuffix")(x):p(x))}function p(x){return x===null||Te(x)?(n.exit("setextHeadingLine"),r(x)):a(x)}}const g3={tokenize:x3};function x3(n){const r=this,a=n.attempt(su,u,n.attempt(this.parser.constructs.flowInitial,s,et(n,n.attempt(this.parser.constructs.flow,s,n.attempt(EN,s)),"linePrefix")));return a;function u(d){if(d===null){n.consume(d);return}return n.enter("lineEndingBlank"),n.consume(d),n.exit("lineEndingBlank"),r.currentConstruct=void 0,a}function s(d){if(d===null){n.consume(d);return}return n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),r.currentConstruct=void 0,a}}const y3={resolveAll:zb()},b3=Ab("string"),v3=Ab("text");function Ab(n){return{resolveAll:zb(n==="text"?w3:void 0),tokenize:r};function r(a){const u=this,s=this.parser.constructs[n],d=a.attempt(s,f,m);return f;function f(y){return x(y)?d(y):m(y)}function m(y){if(y===null){a.consume(y);return}return a.enter("data"),a.consume(y),p}function p(y){return x(y)?(a.exit("data"),d(y)):(a.consume(y),p)}function x(y){if(y===null)return!0;const g=s[y];let w=-1;if(g)for(;++w-1){const m=f[0];typeof m=="string"?f[0]=m.slice(u):f.shift()}d>0&&f.push(n[s].slice(0,d))}return f}function O3(n,r){let a=-1;const u=[];let s;for(;++a0&&s(r.beforeEnter,{...ke,sliceSerialize:K[it][2].sliceSerialize},K[it][1]),Db.call(Tt,K[it][1].type)&&Tt[K[it][1].type].call({...ke,sliceSerialize:K[it][2].sliceSerialize},K[it][1]),K[it][0]==="exit"&&r.afterExit.length>0&&s(r.afterExit,{...ke,sliceSerialize:K[it][2].sliceSerialize},K[it][1])}if(ke.tokenStack.length>0){const Tt=ke.tokenStack[ke.tokenStack.length-1];(Tt[1]||cy).call(ke,void 0,Tt[0])}for(ue.position={start:yi(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:yi(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},it=-1;++it0&&(u.className=["language-"+s[0]]);let d={type:"element",tagName:"code",properties:u,children:[{type:"text",value:a}]};return r.meta&&(d.data={meta:r.meta}),n.patch(r,d),d=n.applyData(r,d),d={type:"element",tagName:"pre",properties:{},children:[d]},n.patch(r,d),d}function I3(n,r){const a={type:"element",tagName:"del",properties:{},children:n.all(r)};return n.patch(r,a),n.applyData(r,a)}function K3(n,r){const a={type:"element",tagName:"em",properties:{},children:n.all(r)};return n.patch(r,a),n.applyData(r,a)}function Z3(n,r){const a=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",u=String(r.identifier).toUpperCase(),s=ta(u.toLowerCase()),d=n.footnoteOrder.indexOf(u);let f,m=n.footnoteCounts.get(u);m===void 0?(m=0,n.footnoteOrder.push(u),f=n.footnoteOrder.length):f=d+1,m+=1,n.footnoteCounts.set(u,m);const p={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+s,id:a+"fnref-"+s+(m>1?"-"+m:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};n.patch(r,p);const x={type:"element",tagName:"sup",properties:{},children:[p]};return n.patch(r,x),n.applyData(r,x)}function $3(n,r){const a={type:"element",tagName:"h"+r.depth,properties:{},children:n.all(r)};return n.patch(r,a),n.applyData(r,a)}function J3(n,r){if(n.options.allowDangerousHtml){const a={type:"raw",value:r.value};return n.patch(r,a),n.applyData(r,a)}}function Ob(n,r){const a=r.referenceType;let u="]";if(a==="collapsed"?u+="[]":a==="full"&&(u+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+u}];const s=n.all(r),d=s[0];d&&d.type==="text"?d.value="["+d.value:s.unshift({type:"text",value:"["});const f=s[s.length-1];return f&&f.type==="text"?f.value+=u:s.push({type:"text",value:u}),s}function P3(n,r){const a=String(r.identifier).toUpperCase(),u=n.definitionById.get(a);if(!u)return Ob(n,r);const s={src:ta(u.url||""),alt:r.alt};u.title!==null&&u.title!==void 0&&(s.title=u.title);const d={type:"element",tagName:"img",properties:s,children:[]};return n.patch(r,d),n.applyData(r,d)}function W3(n,r){const a={src:ta(r.url)};r.alt!==null&&r.alt!==void 0&&(a.alt=r.alt),r.title!==null&&r.title!==void 0&&(a.title=r.title);const u={type:"element",tagName:"img",properties:a,children:[]};return n.patch(r,u),n.applyData(r,u)}function eE(n,r){const a={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};n.patch(r,a);const u={type:"element",tagName:"code",properties:{},children:[a]};return n.patch(r,u),n.applyData(r,u)}function tE(n,r){const a=String(r.identifier).toUpperCase(),u=n.definitionById.get(a);if(!u)return Ob(n,r);const s={href:ta(u.url||"")};u.title!==null&&u.title!==void 0&&(s.title=u.title);const d={type:"element",tagName:"a",properties:s,children:n.all(r)};return n.patch(r,d),n.applyData(r,d)}function nE(n,r){const a={href:ta(r.url)};r.title!==null&&r.title!==void 0&&(a.title=r.title);const u={type:"element",tagName:"a",properties:a,children:n.all(r)};return n.patch(r,u),n.applyData(r,u)}function lE(n,r,a){const u=n.all(r),s=a?iE(a):Rb(r),d={},f=[];if(typeof r.checked=="boolean"){const y=u[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},u.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),d.className=["task-list-item"]}let m=-1;for(;++m0&&s(r.beforeEnter,{...ke,sliceSerialize:K[it][2].sliceSerialize},K[it][1]),Db.call(Tt,K[it][1].type)&&Tt[K[it][1].type].call({...ke,sliceSerialize:K[it][2].sliceSerialize},K[it][1]),K[it][0]==="exit"&&r.afterExit.length>0&&s(r.afterExit,{...ke,sliceSerialize:K[it][2].sliceSerialize},K[it][1])}if(ke.tokenStack.length>0){const Tt=ke.tokenStack[ke.tokenStack.length-1];(Tt[1]||cy).call(ke,void 0,Tt[0])}for(ue.position={start:yi(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:yi(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},it=-1;++it0&&(u.className=["language-"+s[0]]);let d={type:"element",tagName:"code",properties:u,children:[{type:"text",value:a}]};return r.meta&&(d.data={meta:r.meta}),n.patch(r,d),d=n.applyData(r,d),d={type:"element",tagName:"pre",properties:{},children:[d]},n.patch(r,d),d}function K3(n,r){const a={type:"element",tagName:"del",properties:{},children:n.all(r)};return n.patch(r,a),n.applyData(r,a)}function Z3(n,r){const a={type:"element",tagName:"em",properties:{},children:n.all(r)};return n.patch(r,a),n.applyData(r,a)}function $3(n,r){const a=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",u=String(r.identifier).toUpperCase(),s=ta(u.toLowerCase()),d=n.footnoteOrder.indexOf(u);let f,m=n.footnoteCounts.get(u);m===void 0?(m=0,n.footnoteOrder.push(u),f=n.footnoteOrder.length):f=d+1,m+=1,n.footnoteCounts.set(u,m);const p={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+s,id:a+"fnref-"+s+(m>1?"-"+m:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};n.patch(r,p);const x={type:"element",tagName:"sup",properties:{},children:[p]};return n.patch(r,x),n.applyData(r,x)}function J3(n,r){const a={type:"element",tagName:"h"+r.depth,properties:{},children:n.all(r)};return n.patch(r,a),n.applyData(r,a)}function P3(n,r){if(n.options.allowDangerousHtml){const a={type:"raw",value:r.value};return n.patch(r,a),n.applyData(r,a)}}function Ob(n,r){const a=r.referenceType;let u="]";if(a==="collapsed"?u+="[]":a==="full"&&(u+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+u}];const s=n.all(r),d=s[0];d&&d.type==="text"?d.value="["+d.value:s.unshift({type:"text",value:"["});const f=s[s.length-1];return f&&f.type==="text"?f.value+=u:s.push({type:"text",value:u}),s}function W3(n,r){const a=String(r.identifier).toUpperCase(),u=n.definitionById.get(a);if(!u)return Ob(n,r);const s={src:ta(u.url||""),alt:r.alt};u.title!==null&&u.title!==void 0&&(s.title=u.title);const d={type:"element",tagName:"img",properties:s,children:[]};return n.patch(r,d),n.applyData(r,d)}function eE(n,r){const a={src:ta(r.url)};r.alt!==null&&r.alt!==void 0&&(a.alt=r.alt),r.title!==null&&r.title!==void 0&&(a.title=r.title);const u={type:"element",tagName:"img",properties:a,children:[]};return n.patch(r,u),n.applyData(r,u)}function tE(n,r){const a={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};n.patch(r,a);const u={type:"element",tagName:"code",properties:{},children:[a]};return n.patch(r,u),n.applyData(r,u)}function nE(n,r){const a=String(r.identifier).toUpperCase(),u=n.definitionById.get(a);if(!u)return Ob(n,r);const s={href:ta(u.url||"")};u.title!==null&&u.title!==void 0&&(s.title=u.title);const d={type:"element",tagName:"a",properties:s,children:n.all(r)};return n.patch(r,d),n.applyData(r,d)}function lE(n,r){const a={href:ta(r.url)};r.title!==null&&r.title!==void 0&&(a.title=r.title);const u={type:"element",tagName:"a",properties:a,children:n.all(r)};return n.patch(r,u),n.applyData(r,u)}function iE(n,r,a){const u=n.all(r),s=a?rE(a):Rb(r),d={},f=[];if(typeof r.checked=="boolean"){const y=u[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},u.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),d.className=["task-list-item"]}let m=-1;for(;++m1}function rE(n,r){const a={},u=n.all(r);let s=-1;for(typeof r.start=="number"&&r.start!==1&&(a.start=r.start);++s0){const f={type:"element",tagName:"tbody",properties:{},children:n.wrap(a,!0)},m=Id(r.children[1]),p=fb(r.children[r.children.length-1]);m&&p&&(f.position={start:m,end:p}),s.push(f)}const d={type:"element",tagName:"table",properties:{},children:n.wrap(s,!0)};return n.patch(r,d),n.applyData(r,d)}function cE(n,r,a){const u=a?a.children:void 0,d=(u?u.indexOf(r):1)===0?"th":"td",f=a&&a.type==="table"?a.align:void 0,m=f?f.length:r.children.length;let p=-1;const x=[];for(;++p0,!0),u[0]),s=u.index+u[0].length,u=a.exec(r);return d.push(hy(r.slice(s),s>0,!1)),d.join("")}function hy(n,r,a){let u=0,s=n.length;if(r){let d=n.codePointAt(u);for(;d===fy||d===dy;)u++,d=n.codePointAt(u)}if(a){let d=n.codePointAt(s-1);for(;d===fy||d===dy;)s--,d=n.codePointAt(s-1)}return s>u?n.slice(u,s):""}function hE(n,r){const a={type:"text",value:dE(String(r.value))};return n.patch(r,a),n.applyData(r,a)}function mE(n,r){const a={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(r,a),n.applyData(r,a)}const pE={blockquote:G3,break:Q3,code:X3,delete:I3,emphasis:K3,footnoteReference:Z3,heading:$3,html:J3,imageReference:P3,image:W3,inlineCode:eE,linkReference:tE,link:nE,listItem:lE,list:rE,paragraph:aE,root:uE,strong:oE,table:sE,tableCell:fE,tableRow:cE,text:hE,thematicBreak:mE,toml:Xo,yaml:Xo,definition:Xo,footnoteDefinition:Xo};function Xo(){}const Lb=-1,hs=0,au=1,as=2,eh=3,th=4,nh=5,lh=6,Ub=7,Bb=8,{defineProperty:gE}=Object,Hb=typeof self=="object"?self:globalThis,my=(n,r)=>{switch(n){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+n)}return new Hb[n](r)},xE=(n,r)=>{const a=(s,d)=>(n.set(d,s),s),u=s=>{if(n.has(s))return n.get(s);const[d,f]=r[s];switch(d){case hs:case Lb:return a(f,s);case au:{const m=a([],s);for(const p of f)m.push(u(p));return m}case as:{const m=a({},s);for(const[p,x]of f){const y=u(p),g=u(x);y==="__proto__"?gE(m,y,{value:g,configurable:!0,enumerable:!0,writable:!0}):m[y]=g}return m}case eh:return a(new Date(f),s);case th:{const{source:m,flags:p}=f;return a(new RegExp(m,p),s)}case nh:{const m=a(new Map,s);for(const[p,x]of f)m.set(u(p),u(x));return m}case lh:{const m=a(new Set,s);for(const p of f)m.add(u(p));return m}case Ub:{const{name:m,message:p}=f;return a(typeof Hb[m]=="function"?my(m,p):new Error(p),s)}case Bb:return a(BigInt(f),s);case"BigInt":return a(Object(BigInt(f)),s);case"ArrayBuffer":return a(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:m}=new Uint8Array(f);return a(new DataView(m),f)}case"-0":return-0}return a(my(d,f),s)};return u},py=n=>xE(new Map,n)(0),$i="",{toString:yE}={},{keys:bE,is:vE}=Object,eu=n=>{const r=typeof n;if(r!=="object"||!n)return[hs,r];const a=yE.call(n).slice(8,-1);switch(a){case"Array":return[au,$i];case"Object":return[as,$i];case"Date":return[eh,$i];case"RegExp":return[th,$i];case"Map":return[nh,$i];case"Set":return[lh,$i];case"DataView":return[au,a]}return a.includes("Array")?[au,a]:n instanceof Error?[Ub,n.name||"Error"]:[as,a]},Io=([n,r])=>n===hs&&(r==="function"||r==="symbol"),wE=(n,r,a,u)=>{const s=(f,m)=>{const p=u.push(f)-1;return a.set(m,p),p},d=f=>{if(a.has(f))return a.get(f);let[m,p]=eu(f);switch(m){case hs:{let y=f;switch(p){case"bigint":m=Bb,y=f.toString();break;case"number":if(!f&&vE(f,-0))return u.push(["-0"])-1;break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+p);y=null;break;case"undefined":return s([Lb],f)}return s([m,y],f)}case au:{if(p){let w=f;return p==="DataView"?w=new Uint8Array(f.buffer):p==="ArrayBuffer"&&(w=new Uint8Array(f)),s([p,[...w]],f)}const y=[],g=s([m,y],f);for(const w of f)y.push(d(w));return g}case as:{if(p)switch(p){case"BigInt":return s([p,f.toString()],f);case"Boolean":case"Number":case"String":return s([p,f.valueOf()],f)}if(r&&"toJSON"in f)return d(f.toJSON());const y=[],g=s([m,y],f);for(const w of bE(f))(n||!Io(eu(f[w])))&&y.push([d(w),d(f[w])]);return g}case eh:return s([m,isNaN(f.getTime())?$i:f.toISOString()],f);case th:{const{source:y,flags:g}=f;return s([m,{source:y,flags:g}],f)}case nh:{const y=[],g=s([m,y],f);for(const[w,v]of f)(n||!(Io(eu(w))||Io(eu(v))))&&y.push([d(w),d(v)]);return g}case lh:{const y=[],g=s([m,y],f);for(const w of f)(n||!Io(eu(w)))&&y.push(d(w));return g}}const{message:x}=f;return s([m,{name:p,message:x}],f)};return d},gy=(n,{json:r,lossy:a}={})=>{const u=[];return wE(!(r||a),!!r,new Map,u)(n),u},us=typeof structuredClone=="function"?(n,r)=>r&&("json"in r||"lossy"in r)?py(gy(n,r)):structuredClone(n):(n,r)=>py(gy(n,r));function kE(n,r){const a=[{type:"text",value:"↩"}];return r>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),a}function SE(n,r){return"Back to reference "+(n+1)+(r>1?"-"+r:"")}function NE(n){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",a=n.options.footnoteBackContent||kE,u=n.options.footnoteBackLabel||SE,s=n.options.footnoteLabel||"Footnotes",d=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},m=[];let p=-1;for(;++p0&&S.push({type:"text",value:" "});let $=typeof a=="string"?a:a(p,v);typeof $=="string"&&($={type:"text",value:$}),S.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+w+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof u=="string"?u:u(p,v),className:["data-footnote-backref"]},children:Array.isArray($)?$:[$]})}const L=y[y.length-1];if(L&&L.type==="element"&&L.tagName==="p"){const $=L.children[L.children.length-1];$&&$.type==="text"?$.value+=" ":L.children.push({type:"text",value:" "}),L.children.push(...S)}else y.push(...S);const z={type:"element",tagName:"li",properties:{id:r+"fn-"+w},children:n.wrap(y,!0)};n.patch(x,z),m.push(z)}if(m.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:d,properties:{...us(f),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`});const x={type:"element",tagName:"li",properties:d,children:f};return n.patch(r,x),n.applyData(r,x)}function rE(n){let r=!1;if(n.type==="list"){r=n.spread||!1;const a=n.children;let u=-1;for(;!r&&++u1}function aE(n,r){const a={},u=n.all(r);let s=-1;for(typeof r.start=="number"&&r.start!==1&&(a.start=r.start);++s0){const f={type:"element",tagName:"tbody",properties:{},children:n.wrap(a,!0)},m=Id(r.children[1]),p=fb(r.children[r.children.length-1]);m&&p&&(f.position={start:m,end:p}),s.push(f)}const d={type:"element",tagName:"table",properties:{},children:n.wrap(s,!0)};return n.patch(r,d),n.applyData(r,d)}function fE(n,r,a){const u=a?a.children:void 0,d=(u?u.indexOf(r):1)===0?"th":"td",f=a&&a.type==="table"?a.align:void 0,m=f?f.length:r.children.length;let p=-1;const x=[];for(;++p0,!0),u[0]),s=u.index+u[0].length,u=a.exec(r);return d.push(hy(r.slice(s),s>0,!1)),d.join("")}function hy(n,r,a){let u=0,s=n.length;if(r){let d=n.codePointAt(u);for(;d===fy||d===dy;)u++,d=n.codePointAt(u)}if(a){let d=n.codePointAt(s-1);for(;d===fy||d===dy;)s--,d=n.codePointAt(s-1)}return s>u?n.slice(u,s):""}function mE(n,r){const a={type:"text",value:hE(String(r.value))};return n.patch(r,a),n.applyData(r,a)}function pE(n,r){const a={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(r,a),n.applyData(r,a)}const gE={blockquote:Q3,break:X3,code:I3,delete:K3,emphasis:Z3,footnoteReference:$3,heading:J3,html:P3,imageReference:W3,image:eE,inlineCode:tE,linkReference:nE,link:lE,listItem:iE,list:aE,paragraph:uE,root:oE,strong:sE,table:cE,tableCell:dE,tableRow:fE,text:mE,thematicBreak:pE,toml:Qo,yaml:Qo,definition:Qo,footnoteDefinition:Qo};function Qo(){}const Lb=-1,hs=0,au=1,as=2,eh=3,th=4,nh=5,lh=6,Ub=7,Bb=8,{defineProperty:xE}=Object,Hb=typeof self=="object"?self:globalThis,my=(n,r)=>{switch(n){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+n)}return new Hb[n](r)},yE=(n,r)=>{const a=(s,d)=>(n.set(d,s),s),u=s=>{if(n.has(s))return n.get(s);const[d,f]=r[s];switch(d){case hs:case Lb:return a(f,s);case au:{const m=a([],s);for(const p of f)m.push(u(p));return m}case as:{const m=a({},s);for(const[p,x]of f){const y=u(p),g=u(x);y==="__proto__"?xE(m,y,{value:g,configurable:!0,enumerable:!0,writable:!0}):m[y]=g}return m}case eh:return a(new Date(f),s);case th:{const{source:m,flags:p}=f;return a(new RegExp(m,p),s)}case nh:{const m=a(new Map,s);for(const[p,x]of f)m.set(u(p),u(x));return m}case lh:{const m=a(new Set,s);for(const p of f)m.add(u(p));return m}case Ub:{const{name:m,message:p}=f;return a(typeof Hb[m]=="function"?my(m,p):new Error(p),s)}case Bb:return a(BigInt(f),s);case"BigInt":return a(Object(BigInt(f)),s);case"ArrayBuffer":return a(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:m}=new Uint8Array(f);return a(new DataView(m),f)}case"-0":return-0}return a(my(d,f),s)};return u},py=n=>yE(new Map,n)(0),$i="",{toString:bE}={},{keys:vE,is:wE}=Object,eu=n=>{const r=typeof n;if(r!=="object"||!n)return[hs,r];const a=bE.call(n).slice(8,-1);switch(a){case"Array":return[au,$i];case"Object":return[as,$i];case"Date":return[eh,$i];case"RegExp":return[th,$i];case"Map":return[nh,$i];case"Set":return[lh,$i];case"DataView":return[au,a]}return a.includes("Array")?[au,a]:n instanceof Error?[Ub,n.name||"Error"]:[as,a]},Xo=([n,r])=>n===hs&&(r==="function"||r==="symbol"),kE=(n,r,a,u)=>{const s=(f,m)=>{const p=u.push(f)-1;return a.set(m,p),p},d=f=>{if(a.has(f))return a.get(f);let[m,p]=eu(f);switch(m){case hs:{let y=f;switch(p){case"bigint":m=Bb,y=f.toString();break;case"number":if(!f&&wE(f,-0))return u.push(["-0"])-1;break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+p);y=null;break;case"undefined":return s([Lb],f)}return s([m,y],f)}case au:{if(p){let w=f;return p==="DataView"?w=new Uint8Array(f.buffer):p==="ArrayBuffer"&&(w=new Uint8Array(f)),s([p,[...w]],f)}const y=[],g=s([m,y],f);for(const w of f)y.push(d(w));return g}case as:{if(p)switch(p){case"BigInt":return s([p,f.toString()],f);case"Boolean":case"Number":case"String":return s([p,f.valueOf()],f)}if(r&&"toJSON"in f)return d(f.toJSON());const y=[],g=s([m,y],f);for(const w of vE(f))(n||!Xo(eu(f[w])))&&y.push([d(w),d(f[w])]);return g}case eh:return s([m,isNaN(f.getTime())?$i:f.toISOString()],f);case th:{const{source:y,flags:g}=f;return s([m,{source:y,flags:g}],f)}case nh:{const y=[],g=s([m,y],f);for(const[w,v]of f)(n||!(Xo(eu(w))||Xo(eu(v))))&&y.push([d(w),d(v)]);return g}case lh:{const y=[],g=s([m,y],f);for(const w of f)(n||!Xo(eu(w)))&&y.push(d(w));return g}}const{message:x}=f;return s([m,{name:p,message:x}],f)};return d},gy=(n,{json:r,lossy:a}={})=>{const u=[];return kE(!(r||a),!!r,new Map,u)(n),u},us=typeof structuredClone=="function"?(n,r)=>r&&("json"in r||"lossy"in r)?py(gy(n,r)):structuredClone(n):(n,r)=>py(gy(n,r));function SE(n,r){const a=[{type:"text",value:"↩"}];return r>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),a}function NE(n,r){return"Back to reference "+(n+1)+(r>1?"-"+r:"")}function EE(n){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",a=n.options.footnoteBackContent||SE,u=n.options.footnoteBackLabel||NE,s=n.options.footnoteLabel||"Footnotes",d=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},m=[];let p=-1;for(;++p0&&S.push({type:"text",value:" "});let $=typeof a=="string"?a:a(p,v);typeof $=="string"&&($={type:"text",value:$}),S.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+w+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof u=="string"?u:u(p,v),className:["data-footnote-backref"]},children:Array.isArray($)?$:[$]})}const L=y[y.length-1];if(L&&L.type==="element"&&L.tagName==="p"){const $=L.children[L.children.length-1];$&&$.type==="text"?$.value+=" ":L.children.push({type:"text",value:" "}),L.children.push(...S)}else y.push(...S);const D={type:"element",tagName:"li",properties:{id:r+"fn-"+w},children:n.wrap(y,!0)};n.patch(x,D),m.push(D)}if(m.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:d,properties:{...us(f),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:n.wrap(m,!0)},{type:"text",value:` -`}]}}const ms=(function(n){if(n==null)return TE;if(typeof n=="function")return ps(n);if(typeof n=="object")return Array.isArray(n)?EE(n):jE(n);if(typeof n=="string")return CE(n);throw new Error("Expected function, string, or object as test")});function EE(n){const r=[];let a=-1;for(;++a":""))+")"})}return L;function L(){const z=!d||x(w,v,S[S.length-1]||void 0);let $=qb;if(m&&z&&($=xy(m(w,S,v)),$[0]===ns))return $;if("children"in w&&w.children){const I=w;if(I.children&&$[0]!==Dd){let J=(s?-1:I.children.length)+y;const ie=[...S,I];for(;J>-1&&J":""))+")"})}return L;function L(){const D=!d||x(w,v,S[S.length-1]||void 0);let $=qb;if(m&&D&&($=xy(m(w,S,v)),$[0]===ns))return $;if("children"in w&&w.children){const I=w;if(I.children&&$[0]!==Dd){let J=(s?-1:I.children.length)+y;const ie=[...S,I];for(;J>-1&&J0&&a.push({type:"text",value:` -`}),a}function yy(n){let r=0,a=n.charCodeAt(r);for(;a===9||a===32;)r++,a=n.charCodeAt(r);return n.slice(r)}function by(n,r){const a=ME(n,r),u=a.one(n,void 0),s=NE(a),d=Array.isArray(u)?{type:"root",children:u}:u||{type:"root",children:[]};return s&&d.children.push({type:"text",value:` -`},s),d}function BE(n,r){return n&&"run"in n?async function(a,u){const s=by(a,{file:u,...r});await n.run(s,u)}:function(a,u){return by(a,{file:u,...n||r})}}function vy(n){if(n)throw n}var ad,wy;function HE(){if(wy)return ad;wy=1;var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,s=function(x){return typeof Array.isArray=="function"?Array.isArray(x):r.call(x)==="[object Array]"},d=function(x){if(!x||r.call(x)!=="[object Object]")return!1;var y=n.call(x,"constructor"),g=x.constructor&&x.constructor.prototype&&n.call(x.constructor.prototype,"isPrototypeOf");if(x.constructor&&!y&&!g)return!1;var w;for(w in x);return typeof w>"u"||n.call(x,w)},f=function(x,y){a&&y.name==="__proto__"?a(x,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):x[y.name]=y.newValue},m=function(x,y){if(y==="__proto__")if(n.call(x,y)){if(u)return u(x,y).value}else return;return x[y]};return ad=function p(){var x,y,g,w,v,S,C=arguments[0],L=1,z=arguments.length,$=!1;for(typeof C=="boolean"&&($=C,C=arguments[1]||{},L=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});Lf.length;let p;m&&f.push(s);try{p=n.apply(this,f)}catch(x){const y=x;if(m&&a)throw y;return s(y)}m||(p&&p.then&&typeof p.then=="function"?p.then(d,s):p instanceof Error?s(p):d(p))}function s(f,...m){a||(a=!0,r(f,...m))}function d(f){s(null,f)}}const yl={basename:YE,dirname:GE,extname:QE,join:XE,sep:"/"};function YE(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');cu(n);let a=0,u=-1,s=n.length,d;if(r===void 0||r.length===0||r.length>n.length){for(;s--;)if(n.codePointAt(s)===47){if(d){a=s+1;break}}else u<0&&(d=!0,u=s+1);return u<0?"":n.slice(a,u)}if(r===n)return"";let f=-1,m=r.length-1;for(;s--;)if(n.codePointAt(s)===47){if(d){a=s+1;break}}else f<0&&(d=!0,f=s+1),m>-1&&(n.codePointAt(s)===r.codePointAt(m--)?m<0&&(u=s):(m=-1,u=f));return a===u?u=f:u<0&&(u=n.length),n.slice(a,u)}function GE(n){if(cu(n),n.length===0)return".";let r=-1,a=n.length,u;for(;--a;)if(n.codePointAt(a)===47){if(u){r=a;break}}else u||(u=!0);return r<0?n.codePointAt(0)===47?"/":".":r===1&&n.codePointAt(0)===47?"//":n.slice(0,r)}function QE(n){cu(n);let r=n.length,a=-1,u=0,s=-1,d=0,f;for(;r--;){const m=n.codePointAt(r);if(m===47){if(f){u=r+1;break}continue}a<0&&(f=!0,a=r+1),m===46?s<0?s=r:d!==1&&(d=1):s>-1&&(d=-1)}return s<0||a<0||d===0||d===1&&s===a-1&&s===u+1?"":n.slice(s,a)}function XE(...n){let r=-1,a;for(;++r0&&n.codePointAt(n.length-1)===47&&(a+="/"),r?"/"+a:a}function KE(n,r){let a="",u=0,s=-1,d=0,f=-1,m,p;for(;++f<=n.length;){if(f2){if(p=a.lastIndexOf("/"),p!==a.length-1){p<0?(a="",u=0):(a=a.slice(0,p),u=a.length-1-a.lastIndexOf("/")),s=f,d=0;continue}}else if(a.length>0){a="",u=0,s=f,d=0;continue}}r&&(a=a.length>0?a+"/..":"..",u=2)}else a.length>0?a+="/"+n.slice(s+1,f):a=n.slice(s+1,f),u=f-s-1;s=f,d=0}else m===46&&d>-1?d++:d=-1}return a}function cu(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const ZE={cwd:$E};function $E(){return"/"}function Ud(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function JE(n){if(typeof n=="string")n=new URL(n);else if(!Ud(n)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(n.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return PE(n)}function PE(n){if(n.hostname!==""){const u=new TypeError('File URL host must be "localhost" or empty on darwin');throw u.code="ERR_INVALID_FILE_URL_HOST",u}const r=n.pathname;let a=-1;for(;++a0){let[v,...S]=y;const C=u[w][1];Ld(C)&&Ld(v)&&(v=ud(!0,C,v)),u[w]=[x,v,...S]}}}}const nj=new rh().freeze();function fd(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function dd(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function hd(n,r){if(r)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Sy(n){if(!Ld(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function Ny(n,r,a){if(!a)throw new Error("`"+n+"` finished async. Use `"+r+"` instead")}function Ko(n){return lj(n)?n:new Fb(n)}function lj(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function ij(n){return typeof n=="string"||rj(n)}function rj(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const aj="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ey=[],jy={allowDangerousHtml:!0},uj=/^(https?|ircs?|mailto|xmpp)$/i,oj=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function sj(n){const r=cj(n),a=fj(n);return dj(r.runSync(r.parse(a),a),n)}function cj(n){const r=n.rehypePlugins||Ey,a=n.remarkPlugins||Ey,u=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...jy}:jy;return nj().use(Y3).use(a).use(BE,u).use(r)}function fj(n){const r=n.children||"",a=new Fb;return typeof r=="string"&&(a.value=r),a}function dj(n,r){const a=r.allowedElements,u=r.allowElement,s=r.components,d=r.disallowedElements,f=r.skipHtml,m=r.unwrapDisallowed,p=r.urlTransform||hj;for(const y of oj)Object.hasOwn(r,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+aj+y.id,void 0);return ih(n,x),_S(n,{Fragment:h.Fragment,components:s,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function x(y,g,w){if(y.type==="raw"&&w&&typeof g=="number")return f?w.children.splice(g,1):w.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let v;for(v in ld)if(Object.hasOwn(ld,v)&&Object.hasOwn(y.properties,v)){const S=y.properties[v],C=ld[v];(C===null||C.includes(y.tagName))&&(y.properties[v]=p(String(S||""),v,y))}}if(y.type==="element"){let v=a?!a.includes(y.tagName):d?d.includes(y.tagName):!1;if(!v&&u&&typeof g=="number"&&(v=!u(y,g,w)),v&&w&&typeof g=="number")return m&&y.children?w.children.splice(g,1,...y.children):w.children.splice(g,1),g}}}function hj(n){const r=n.indexOf(":"),a=n.indexOf("?"),u=n.indexOf("#"),s=n.indexOf("/");return r===-1||s!==-1&&r>s||a!==-1&&r>a||u!==-1&&r>u||uj.test(n.slice(0,r))?n:""}function mj(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Vb(n,r,a){const s=ms((a||{}).ignore||[]),d=pj(r);let f=-1;for(;++f0?{type:"text",value:U}:void 0),U===!1)v.lastIndex=J+1;else{if(C!==J&&I({type:"text",value:x.value.slice(C,J)}),Array.isArray(U))for(const R of U)I(R);else U&&I(U);C=J+$[0].length,L=!0}if(!v.global)break;$=v.exec(x.value)}return L?(C?\]}]+$/.exec(n);if(!r)return[n,void 0];n=n.slice(0,r.index);let a=r[0],u=a.indexOf(")");const s=Cy(n,"(");let d=Cy(n,")");for(;u!==-1&&s>d;)n+=a.slice(0,u+1),a=a.slice(u+1),u=a.indexOf(")"),d++;return[n,a]}function Yb(n,r){const a=n.input.charCodeAt(n.index-1);return(n.index===0||tr(a)||fs(a))&&(!r||a!==47)}Gb.peek=Fj;function Mj(){this.buffer()}function Oj(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function Rj(){this.buffer()}function Lj(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function Uj(n){const r=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=tl(this.sliceSerialize(n)).toLowerCase(),a.label=r}function Bj(n){this.exit(n)}function Hj(n){const r=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=tl(this.sliceSerialize(n)).toLowerCase(),a.label=r}function qj(n){this.exit(n)}function Fj(){return"["}function Gb(n,r,a,u){const s=a.createTracker(u);let d=s.move("[^");const f=a.enter("footnoteReference"),m=a.enter("reference");return d+=s.move(a.safe(a.associationId(n),{after:"]",before:d})),m(),f(),d+=s.move("]"),d}function Vj(){return{enter:{gfmFootnoteCallString:Mj,gfmFootnoteCall:Oj,gfmFootnoteDefinitionLabelString:Rj,gfmFootnoteDefinition:Lj},exit:{gfmFootnoteCallString:Uj,gfmFootnoteCall:Bj,gfmFootnoteDefinitionLabelString:Hj,gfmFootnoteDefinition:qj}}}function Yj(n){let r=!1;return n&&n.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:a,footnoteReference:Gb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(u,s,d,f){const m=d.createTracker(f);let p=m.move("[^");const x=d.enter("footnoteDefinition"),y=d.enter("label");return p+=m.move(d.safe(d.associationId(u),{before:p,after:"]"})),y(),p+=m.move("]:"),u.children&&u.children.length>0&&(m.shift(4),p+=m.move((r?` -`:" ")+d.indentLines(d.containerFlow(u,m.current()),r?Qb:Gj))),x(),p}}function Gj(n,r,a){return r===0?n:Qb(n,r,a)}function Qb(n,r,a){return(a?"":" ")+n}const Qj=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ah.attention=$j;ah.peek=Jj;function Xj(){return{canContainEols:["delete"],enter:{strikethrough:Kj},exit:{strikethrough:Zj}}}function Ij(){return{handlers:{delete:ah},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Qj}]}}function Kj(n){this.enter({type:"delete",children:[],position:void 0},n)}function Zj(n){this.exit(n)}function ah(n,r,a,u){const s=a.createTracker(u),d=a.stack.includes("strikethrough")?"~":"~~",f=a.enter("strikethrough");let m=s.move(d);return m+=a.containerPhrasing(n,{...s.current(),before:m,after:"~"}),m+=s.move(d),f(),m}function $j(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function Jj(){return"~"}function Pj(n){return n.length}function Wj(n,r){const a=r||{},u=(a.align||[]).concat(),s=a.stringLength||Pj,d=[],f=[],m=[],p=[];let x=0,y=-1;for(;++yx&&(x=n[y].length);++zp[z])&&(p[z]=I)}C.push($)}f[y]=C,m[y]=L}let g=-1;if(typeof u=="object"&&"length"in u)for(;++gp[g]&&(p[g]=$),v[g]=$),w[g]=I}f.splice(1,0,w),m.splice(1,0,v),y=-1;const S=[];for(;++y "),d.shift(2);const f=a.indentLines(a.containerFlow(n,d.current()),l5);return s(),f}function l5(n,r,a){return">"+(a?"":" ")+n}function i5(n,r){return _y(n,r.inConstruct,!0)&&!_y(n,r.notInConstruct,!1)}function _y(n,r,a){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return a;let u=-1;for(;++uf&&(f=d):d=1,s=u+r.length,u=a.indexOf(r,s);return f}function a5(n,r){return!!(r.options.fences===!1&&n.value&&!n.lang&&/[^\n\r ]/.test(n.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(n.value))}function u5(n){const r=n.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function o5(n,r,a,u){const s=u5(a),d=n.value||"";if(a5(n,a)){const g=a.enter("codeIndented"),w=a.indentLines(d,s5);return g(),w}const f=a.createTracker(u),m=s.repeat(Math.max(r5(d,s)+1,3)),p=a.enter("codeFenced"),x=s==="`"?"GraveAccent":"Tilde";let y=f.move(m);if(n.lang){const g=a.enter(`codeFencedLang${x}`);y+=f.move(a.safe(n.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(n.lang&&n.meta){const g=a.enter(`codeFencedMeta${x}`);y+=f.move(" "),y+=f.move(a.safe(n.meta,{before:y,after:` +`}),a}function yy(n){let r=0,a=n.charCodeAt(r);for(;a===9||a===32;)r++,a=n.charCodeAt(r);return n.slice(r)}function by(n,r){const a=OE(n,r),u=a.one(n,void 0),s=EE(a),d=Array.isArray(u)?{type:"root",children:u}:u||{type:"root",children:[]};return s&&d.children.push({type:"text",value:` +`},s),d}function HE(n,r){return n&&"run"in n?async function(a,u){const s=by(a,{file:u,...r});await n.run(s,u)}:function(a,u){return by(a,{file:u,...n||r})}}function vy(n){if(n)throw n}var ad,wy;function qE(){if(wy)return ad;wy=1;var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,s=function(x){return typeof Array.isArray=="function"?Array.isArray(x):r.call(x)==="[object Array]"},d=function(x){if(!x||r.call(x)!=="[object Object]")return!1;var y=n.call(x,"constructor"),g=x.constructor&&x.constructor.prototype&&n.call(x.constructor.prototype,"isPrototypeOf");if(x.constructor&&!y&&!g)return!1;var w;for(w in x);return typeof w>"u"||n.call(x,w)},f=function(x,y){a&&y.name==="__proto__"?a(x,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):x[y.name]=y.newValue},m=function(x,y){if(y==="__proto__")if(n.call(x,y)){if(u)return u(x,y).value}else return;return x[y]};return ad=function p(){var x,y,g,w,v,S,T=arguments[0],L=1,D=arguments.length,$=!1;for(typeof T=="boolean"&&($=T,T=arguments[1]||{},L=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});Lf.length;let p;m&&f.push(s);try{p=n.apply(this,f)}catch(x){const y=x;if(m&&a)throw y;return s(y)}m||(p&&p.then&&typeof p.then=="function"?p.then(d,s):p instanceof Error?s(p):d(p))}function s(f,...m){a||(a=!0,r(f,...m))}function d(f){s(null,f)}}const yl={basename:GE,dirname:QE,extname:XE,join:IE,sep:"/"};function GE(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');cu(n);let a=0,u=-1,s=n.length,d;if(r===void 0||r.length===0||r.length>n.length){for(;s--;)if(n.codePointAt(s)===47){if(d){a=s+1;break}}else u<0&&(d=!0,u=s+1);return u<0?"":n.slice(a,u)}if(r===n)return"";let f=-1,m=r.length-1;for(;s--;)if(n.codePointAt(s)===47){if(d){a=s+1;break}}else f<0&&(d=!0,f=s+1),m>-1&&(n.codePointAt(s)===r.codePointAt(m--)?m<0&&(u=s):(m=-1,u=f));return a===u?u=f:u<0&&(u=n.length),n.slice(a,u)}function QE(n){if(cu(n),n.length===0)return".";let r=-1,a=n.length,u;for(;--a;)if(n.codePointAt(a)===47){if(u){r=a;break}}else u||(u=!0);return r<0?n.codePointAt(0)===47?"/":".":r===1&&n.codePointAt(0)===47?"//":n.slice(0,r)}function XE(n){cu(n);let r=n.length,a=-1,u=0,s=-1,d=0,f;for(;r--;){const m=n.codePointAt(r);if(m===47){if(f){u=r+1;break}continue}a<0&&(f=!0,a=r+1),m===46?s<0?s=r:d!==1&&(d=1):s>-1&&(d=-1)}return s<0||a<0||d===0||d===1&&s===a-1&&s===u+1?"":n.slice(s,a)}function IE(...n){let r=-1,a;for(;++r0&&n.codePointAt(n.length-1)===47&&(a+="/"),r?"/"+a:a}function ZE(n,r){let a="",u=0,s=-1,d=0,f=-1,m,p;for(;++f<=n.length;){if(f2){if(p=a.lastIndexOf("/"),p!==a.length-1){p<0?(a="",u=0):(a=a.slice(0,p),u=a.length-1-a.lastIndexOf("/")),s=f,d=0;continue}}else if(a.length>0){a="",u=0,s=f,d=0;continue}}r&&(a=a.length>0?a+"/..":"..",u=2)}else a.length>0?a+="/"+n.slice(s+1,f):a=n.slice(s+1,f),u=f-s-1;s=f,d=0}else m===46&&d>-1?d++:d=-1}return a}function cu(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const $E={cwd:JE};function JE(){return"/"}function Ud(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function PE(n){if(typeof n=="string")n=new URL(n);else if(!Ud(n)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(n.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return WE(n)}function WE(n){if(n.hostname!==""){const u=new TypeError('File URL host must be "localhost" or empty on darwin');throw u.code="ERR_INVALID_FILE_URL_HOST",u}const r=n.pathname;let a=-1;for(;++a0){let[v,...S]=y;const T=u[w][1];Ld(T)&&Ld(v)&&(v=ud(!0,T,v)),u[w]=[x,v,...S]}}}}const lj=new rh().freeze();function fd(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function dd(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function hd(n,r){if(r)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Sy(n){if(!Ld(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function Ny(n,r,a){if(!a)throw new Error("`"+n+"` finished async. Use `"+r+"` instead")}function Io(n){return ij(n)?n:new Fb(n)}function ij(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function rj(n){return typeof n=="string"||aj(n)}function aj(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const uj="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ey=[],jy={allowDangerousHtml:!0},oj=/^(https?|ircs?|mailto|xmpp)$/i,sj=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function cj(n){const r=fj(n),a=dj(n);return hj(r.runSync(r.parse(a),a),n)}function fj(n){const r=n.rehypePlugins||Ey,a=n.remarkPlugins||Ey,u=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...jy}:jy;return lj().use(G3).use(a).use(HE,u).use(r)}function dj(n){const r=n.children||"",a=new Fb;return typeof r=="string"&&(a.value=r),a}function hj(n,r){const a=r.allowedElements,u=r.allowElement,s=r.components,d=r.disallowedElements,f=r.skipHtml,m=r.unwrapDisallowed,p=r.urlTransform||mj;for(const y of sj)Object.hasOwn(r,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+uj+y.id,void 0);return ih(n,x),AS(n,{Fragment:h.Fragment,components:s,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function x(y,g,w){if(y.type==="raw"&&w&&typeof g=="number")return f?w.children.splice(g,1):w.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let v;for(v in ld)if(Object.hasOwn(ld,v)&&Object.hasOwn(y.properties,v)){const S=y.properties[v],T=ld[v];(T===null||T.includes(y.tagName))&&(y.properties[v]=p(String(S||""),v,y))}}if(y.type==="element"){let v=a?!a.includes(y.tagName):d?d.includes(y.tagName):!1;if(!v&&u&&typeof g=="number"&&(v=!u(y,g,w)),v&&w&&typeof g=="number")return m&&y.children?w.children.splice(g,1,...y.children):w.children.splice(g,1),g}}}function mj(n){const r=n.indexOf(":"),a=n.indexOf("?"),u=n.indexOf("#"),s=n.indexOf("/");return r===-1||s!==-1&&r>s||a!==-1&&r>a||u!==-1&&r>u||oj.test(n.slice(0,r))?n:""}function pj(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Vb(n,r,a){const s=ms((a||{}).ignore||[]),d=gj(r);let f=-1;for(;++f0?{type:"text",value:U}:void 0),U===!1)v.lastIndex=J+1;else{if(T!==J&&I({type:"text",value:x.value.slice(T,J)}),Array.isArray(U))for(const R of U)I(R);else U&&I(U);T=J+$[0].length,L=!0}if(!v.global)break;$=v.exec(x.value)}return L?(T?\]}]+$/.exec(n);if(!r)return[n,void 0];n=n.slice(0,r.index);let a=r[0],u=a.indexOf(")");const s=Cy(n,"(");let d=Cy(n,")");for(;u!==-1&&s>d;)n+=a.slice(0,u+1),a=a.slice(u+1),u=a.indexOf(")"),d++;return[n,a]}function Yb(n,r){const a=n.input.charCodeAt(n.index-1);return(n.index===0||tr(a)||fs(a))&&(!r||a!==47)}Gb.peek=Vj;function Oj(){this.buffer()}function Rj(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function Lj(){this.buffer()}function Uj(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function Bj(n){const r=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=tl(this.sliceSerialize(n)).toLowerCase(),a.label=r}function Hj(n){this.exit(n)}function qj(n){const r=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=tl(this.sliceSerialize(n)).toLowerCase(),a.label=r}function Fj(n){this.exit(n)}function Vj(){return"["}function Gb(n,r,a,u){const s=a.createTracker(u);let d=s.move("[^");const f=a.enter("footnoteReference"),m=a.enter("reference");return d+=s.move(a.safe(a.associationId(n),{after:"]",before:d})),m(),f(),d+=s.move("]"),d}function Yj(){return{enter:{gfmFootnoteCallString:Oj,gfmFootnoteCall:Rj,gfmFootnoteDefinitionLabelString:Lj,gfmFootnoteDefinition:Uj},exit:{gfmFootnoteCallString:Bj,gfmFootnoteCall:Hj,gfmFootnoteDefinitionLabelString:qj,gfmFootnoteDefinition:Fj}}}function Gj(n){let r=!1;return n&&n.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:a,footnoteReference:Gb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(u,s,d,f){const m=d.createTracker(f);let p=m.move("[^");const x=d.enter("footnoteDefinition"),y=d.enter("label");return p+=m.move(d.safe(d.associationId(u),{before:p,after:"]"})),y(),p+=m.move("]:"),u.children&&u.children.length>0&&(m.shift(4),p+=m.move((r?` +`:" ")+d.indentLines(d.containerFlow(u,m.current()),r?Qb:Qj))),x(),p}}function Qj(n,r,a){return r===0?n:Qb(n,r,a)}function Qb(n,r,a){return(a?"":" ")+n}const Xj=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ah.attention=Jj;ah.peek=Pj;function Ij(){return{canContainEols:["delete"],enter:{strikethrough:Zj},exit:{strikethrough:$j}}}function Kj(){return{handlers:{delete:ah},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Xj}]}}function Zj(n){this.enter({type:"delete",children:[],position:void 0},n)}function $j(n){this.exit(n)}function ah(n,r,a,u){const s=a.createTracker(u),d=a.stack.includes("strikethrough")?"~":"~~",f=a.enter("strikethrough");let m=s.move(d);return m+=a.containerPhrasing(n,{...s.current(),before:m,after:"~"}),m+=s.move(d),f(),m}function Jj(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function Pj(){return"~"}function Wj(n){return n.length}function e5(n,r){const a=r||{},u=(a.align||[]).concat(),s=a.stringLength||Wj,d=[],f=[],m=[],p=[];let x=0,y=-1;for(;++yx&&(x=n[y].length);++Dp[D])&&(p[D]=I)}T.push($)}f[y]=T,m[y]=L}let g=-1;if(typeof u=="object"&&"length"in u)for(;++gp[g]&&(p[g]=$),v[g]=$),w[g]=I}f.splice(1,0,w),m.splice(1,0,v),y=-1;const S=[];for(;++y "),d.shift(2);const f=a.indentLines(a.containerFlow(n,d.current()),i5);return s(),f}function i5(n,r,a){return">"+(a?"":" ")+n}function r5(n,r){return _y(n,r.inConstruct,!0)&&!_y(n,r.notInConstruct,!1)}function _y(n,r,a){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return a;let u=-1;for(;++uf&&(f=d):d=1,s=u+r.length,u=a.indexOf(r,s);return f}function u5(n,r){return!!(r.options.fences===!1&&n.value&&!n.lang&&/[^\n\r ]/.test(n.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(n.value))}function o5(n){const r=n.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function s5(n,r,a,u){const s=o5(a),d=n.value||"";if(u5(n,a)){const g=a.enter("codeIndented"),w=a.indentLines(d,c5);return g(),w}const f=a.createTracker(u),m=s.repeat(Math.max(a5(d,s)+1,3)),p=a.enter("codeFenced"),x=s==="`"?"GraveAccent":"Tilde";let y=f.move(m);if(n.lang){const g=a.enter(`codeFencedLang${x}`);y+=f.move(a.safe(n.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(n.lang&&n.meta){const g=a.enter(`codeFencedMeta${x}`);y+=f.move(" "),y+=f.move(a.safe(n.meta,{before:y,after:` `,encode:["`"],...f.current()})),g()}return y+=f.move(` `),d&&(y+=f.move(d+` -`)),y+=f.move(m),p(),y}function s5(n,r,a){return(a?"":" ")+n}function uh(n){const r=n.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function c5(n,r,a,u){const s=uh(a),d=s==='"'?"Quote":"Apostrophe",f=a.enter("definition");let m=a.enter("label");const p=a.createTracker(u);let x=p.move("[");return x+=p.move(a.safe(a.associationId(n),{before:x,after:"]",...p.current()})),x+=p.move("]: "),m(),!n.url||/[\0- \u007F]/.test(n.url)?(m=a.enter("destinationLiteral"),x+=p.move("<"),x+=p.move(a.safe(n.url,{before:x,after:">",...p.current()})),x+=p.move(">")):(m=a.enter("destinationRaw"),x+=p.move(a.safe(n.url,{before:x,after:n.title?" ":` -`,...p.current()}))),m(),n.title&&(m=a.enter(`title${d}`),x+=p.move(" "+s),x+=p.move(a.safe(n.title,{before:x,after:s,...p.current()})),x+=p.move(s),m()),f(),x}function f5(n){const r=n.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function os(n){const r=n.codePointAt(0);return r===void 0?"":String.fromCodePoint(r)}function Jr(n){const r=n.codePointAt(n.length-2);return r!==void 0&&r>65535?n.slice(-2):n.slice(-1)}function Xb(n){return"&#x"+n.toString(16).toUpperCase()+";"}function zy(n,r,a){const u=wi(n),s=wi(r);return u===void 0?s===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:u===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function d5(n){if(n.charCodeAt(0)!==60)return;const r=n.charCodeAt(1);if(r===33){const m=n.charCodeAt(2);return m===45?2:m===91?5:Pt(m)?4:void 0}if(r===63)return 3;const a=r===47,u=a?2:1;let s=u,d=n.charCodeAt(s);if(!Pt(d))return;for(;d===45||Wt(d);)d=n.charCodeAt(++s);const f=n.slice(u,s).toLowerCase();return!a&&d!==47&&zd.includes(f)?1:_b.includes(f)?6:7}const h5=new Map([["*",!1],["_",!0]]);function m5(n,r,a){const u=new Set;for(const d of n){const f=a.get(d);if(f&&d.attention&&r.some(m=>m.attention===d.attention))for(const m of f.tokens)u.add(m.attention)}const s=[];for(const d of n)d.attention&&u.delete(d.attention)&&s.push(d.attention);return s.reverse(),s}function Ib(n,r,a){const u=[],s=new Map,d=new Map;let f=0;for(;fa.index)return{chosen:p,mistake:y,tokens:x}}}}function g5(n,r){const a=new Map;for(const u of n){const s=u.tokens[0].value.charAt(0);let d=a.get(s);d||(d=[],a.set(s,d));let f=u.close?d.length:0;for(;f--&&u.start1&&x>1?2:1:x,g=m.markers.slice(m.end-y,m.end),w=u.markers.slice(u.start,u.start+y),v=g[0],S=w[0];if(v===g[y-1]&&v.value.length===y&&S===w[y-1]&&S.value.length===y&&v.attention===S.attention)r.delete(v),r.delete(S);else{const C=[...new Set([...g,...w])];for(const L of C){const z=r.get(L);z&&z.push(...C)}}m.end-=y,u.start+=y,m.start===m.end&&d.splice(f,1),f=d.length}u.open&&u.start0?S[0].value:"",L=zy(w.charCodeAt(w.length-1),C.charCodeAt(0),y);L.inside&&Zo(S,!0);const z=S.length>0?Jr(S[S.length-1].value):"",$=zy(v.charCodeAt(0),z.charCodeAt(z.length-1),y);$.inside&&Zo(S,!1),L.outside&&w!==` -`&&w!=="\r"&&Zo(s,!1),$.outside&&(d=v),s.push({value:x,attention:p},...S,{value:x,attention:p}),f=x.charAt(x.length-1)}return s}function gs(n,r,a){let u=new Map;const s=sh(n,u,r,a);let d=s,f=Ib(d,r,a);for(;f;){const p=p5(n,u,f,r,a);if(!p){d=s;break}u=p.chosen,d=p.tokens,f=p.mistake}let m="";for(const p of d)m+=p.value;return m}ch.attention=Kb;ch.peek=b5;function ch(n,r,a,u){const s=a.enter("phrasing"),d=oh(n,Kb,a,a.createTracker(u)),f=gs([d],u.before,u.after);return s(),f}function Kb(n,r){return{construct:"emphasis",markers:f5(r)==="*"?["*","_"]:["_","*"],sizes:[1]}}function b5(n,r,a){return a.options.emphasis||"*"}function v5(n,r){let a=!1;return ih(n,function(u){if("value"in u&&/\r?\n|\r/.test(u.value)||u.type==="break")return a=!0,ns}),!!((!n.depth||n.depth<3)&&Jd(n)&&(r.options.setext||a))}function w5(n,r,a,u){const s=Math.max(Math.min(6,n.depth||1),1),d=a.createTracker(u);if(v5(n,a)){const g=a.enter("headingSetext"),w=a.enter("phrasing"),v=a.containerPhrasing(n,{...d.current(),before:` +`)),y+=f.move(m),p(),y}function c5(n,r,a){return(a?"":" ")+n}function uh(n){const r=n.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function f5(n,r,a,u){const s=uh(a),d=s==='"'?"Quote":"Apostrophe",f=a.enter("definition");let m=a.enter("label");const p=a.createTracker(u);let x=p.move("[");return x+=p.move(a.safe(a.associationId(n),{before:x,after:"]",...p.current()})),x+=p.move("]: "),m(),!n.url||/[\0- \u007F]/.test(n.url)?(m=a.enter("destinationLiteral"),x+=p.move("<"),x+=p.move(a.safe(n.url,{before:x,after:">",...p.current()})),x+=p.move(">")):(m=a.enter("destinationRaw"),x+=p.move(a.safe(n.url,{before:x,after:n.title?" ":` +`,...p.current()}))),m(),n.title&&(m=a.enter(`title${d}`),x+=p.move(" "+s),x+=p.move(a.safe(n.title,{before:x,after:s,...p.current()})),x+=p.move(s),m()),f(),x}function d5(n){const r=n.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function os(n){const r=n.codePointAt(0);return r===void 0?"":String.fromCodePoint(r)}function Jr(n){const r=n.codePointAt(n.length-2);return r!==void 0&&r>65535?n.slice(-2):n.slice(-1)}function Xb(n){return"&#x"+n.toString(16).toUpperCase()+";"}function zy(n,r,a){const u=wi(n),s=wi(r);return u===void 0?s===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:u===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function h5(n){if(n.charCodeAt(0)!==60)return;const r=n.charCodeAt(1);if(r===33){const m=n.charCodeAt(2);return m===45?2:m===91?5:Pt(m)?4:void 0}if(r===63)return 3;const a=r===47,u=a?2:1;let s=u,d=n.charCodeAt(s);if(!Pt(d))return;for(;d===45||Wt(d);)d=n.charCodeAt(++s);const f=n.slice(u,s).toLowerCase();return!a&&d!==47&&zd.includes(f)?1:_b.includes(f)?6:7}const m5=new Map([["*",!1],["_",!0]]);function p5(n,r,a){const u=new Set;for(const d of n){const f=a.get(d);if(f&&d.attention&&r.some(m=>m.attention===d.attention))for(const m of f.tokens)u.add(m.attention)}const s=[];for(const d of n)d.attention&&u.delete(d.attention)&&s.push(d.attention);return s.reverse(),s}function Ib(n,r,a){const u=[],s=new Map,d=new Map;let f=0;for(;fa.index)return{chosen:p,mistake:y,tokens:x}}}}function x5(n,r){const a=new Map;for(const u of n){const s=u.tokens[0].value.charAt(0);let d=a.get(s);d||(d=[],a.set(s,d));let f=u.close?d.length:0;for(;f--&&u.start1&&x>1?2:1:x,g=m.markers.slice(m.end-y,m.end),w=u.markers.slice(u.start,u.start+y),v=g[0],S=w[0];if(v===g[y-1]&&v.value.length===y&&S===w[y-1]&&S.value.length===y&&v.attention===S.attention)r.delete(v),r.delete(S);else{const T=[...new Set([...g,...w])];for(const L of T){const D=r.get(L);D&&D.push(...T)}}m.end-=y,u.start+=y,m.start===m.end&&d.splice(f,1),f=d.length}u.open&&u.start0?S[0].value:"",L=zy(w.charCodeAt(w.length-1),T.charCodeAt(0),y);L.inside&&Ko(S,!0);const D=S.length>0?Jr(S[S.length-1].value):"",$=zy(v.charCodeAt(0),D.charCodeAt(D.length-1),y);$.inside&&Ko(S,!1),L.outside&&w!==` +`&&w!=="\r"&&Ko(s,!1),$.outside&&(d=v),s.push({value:x,attention:p},...S,{value:x,attention:p}),f=x.charAt(x.length-1)}return s}function gs(n,r,a){let u=new Map;const s=sh(n,u,r,a);let d=s,f=Ib(d,r,a);for(;f;){const p=g5(n,u,f,r,a);if(!p){d=s;break}u=p.chosen,d=p.tokens,f=p.mistake}let m="";for(const p of d)m+=p.value;return m}ch.attention=Kb;ch.peek=v5;function ch(n,r,a,u){const s=a.enter("phrasing"),d=oh(n,Kb,a,a.createTracker(u)),f=gs([d],u.before,u.after);return s(),f}function Kb(n,r){return{construct:"emphasis",markers:d5(r)==="*"?["*","_"]:["_","*"],sizes:[1]}}function v5(n,r,a){return a.options.emphasis||"*"}function w5(n,r){let a=!1;return ih(n,function(u){if("value"in u&&/\r?\n|\r/.test(u.value)||u.type==="break")return a=!0,ns}),!!((!n.depth||n.depth<3)&&Jd(n)&&(r.options.setext||a))}function k5(n,r,a,u){const s=Math.max(Math.min(6,n.depth||1),1),d=a.createTracker(u);if(w5(n,a)){const g=a.enter("headingSetext"),w=a.enter("phrasing"),v=a.containerPhrasing(n,{...d.current(),before:` `,after:` `});return w(),g(),v+` `+(s===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(` `))+1))}const f="#".repeat(s),m=a.enter("headingAtx"),p=a.enter("phrasing");d.move(f+" ");let x=a.containerPhrasing(n,{before:"# ",after:` -`,...d.current()});const y=x.charCodeAt(0);return(y===9||y===32)&&(x=Xb(y)+x.slice(1)),x=x?f+" "+x:f,a.options.closeAtx&&(x+=" "+f),p(),m(),x}Zb.peek=k5;function Zb(n){return n.value||""}function k5(){return"<"}$b.peek=S5;function $b(n,r,a,u){const s=uh(a),d=s==='"'?"Quote":"Apostrophe",f=a.enter("image");let m=a.enter("label");const p=a.createTracker(u);let x=p.move("![");return x+=p.move(a.safe(n.alt,{before:x,after:"]",...p.current()})),x+=p.move("]("),m(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(m=a.enter("destinationLiteral"),x+=p.move("<"),x+=p.move(a.safe(n.url,{before:x,after:">",...p.current()})),x+=p.move(">")):(m=a.enter("destinationRaw"),x+=p.move(a.safe(n.url,{before:x,after:n.title?" ":")",...p.current()}))),m(),n.title&&(m=a.enter(`title${d}`),x+=p.move(" "+s),x+=p.move(a.safe(n.title,{before:x,after:s,...p.current()})),x+=p.move(s),m()),x+=p.move(")"),f(),x}function S5(){return"!"}Jb.peek=N5;function Jb(n,r,a,u){const s=n.referenceType,d=a.enter("imageReference");let f=a.enter("label");const m=a.createTracker(u);let p=m.move("![");const x=a.safe(n.alt,{before:p,after:"]",...m.current()});p+=m.move(x+"]["),f();const y=a.stack;a.stack=y.filter(function(w){return w!=="phrasing"}),f=a.enter("reference");const g=a.safe(a.associationId(n),{before:p,after:"]",...m.current()});return f(),a.stack=y,d(),s==="full"||!x||x!==g?p+=m.move(g+"]"):s==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function N5(){return"!"}Pb.peek=E5;function Pb(n,r,a){let u=n.value||"",s="`",d=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(u);)s+="`";for(/[^\n\r ]/.test(u)&&(/^[\n\r ]/.test(u)&&/[\n\r ]$/.test(u)||/^`|`$/.test(u))&&(u=" "+u+" ");++d\u007F]/.test(n.url))}e0.peek=j5;function e0(n,r,a,u){const s=uh(a),d=s==='"'?"Quote":"Apostrophe",f=a.createTracker(u);if(Wb(n,a)){const S=a.stack;a.stack=S.filter(function(z){return z!=="phrasing"});const C=a.enter("autolink");let L=f.move("<");return L+=f.move(a.containerPhrasing(n,{before:L,after:">",...f.current()})),L+=f.move(">"),C(),a.stack=S,L}const m=a.enter("link");let p=a.enter("label"),x=f.move("[");const y=a.containerPhrasing(n,{before:x,after:"](",...f.current()});x+=f.move(y),p(),x+=f.move("](");const g=/[\0- \u007F]/.test(n.url),w=u.before.charAt(u.before.length-1);let v=n.title||void 0;if(!v&&!g&&(w===` -`||w==="\r")){let S=0;for(;S",...f.current()})),x+=f.move(">")):(p=a.enter("destinationRaw"),x+=f.move(a.safe(n.url,{before:x,after:typeof v=="string"?" ":")",...f.current()}))),p(),typeof v=="string"&&(p=a.enter(`title${d}`),x+=f.move(" "+s),x+=f.move(a.safe(v,{before:x,after:s,...f.current()})),x+=f.move(s),p()),x+=f.move(")"),m(),x}function j5(n,r,a){return Wb(n,a)?"<":"["}t0.peek=C5;function t0(n,r,a,u){const s=n.referenceType,d=a.enter("linkReference");let f=a.enter("label");const m=a.createTracker(u);let p=m.move("[");const x=a.containerPhrasing(n,{before:p,after:"]",...m.current()});p+=m.move(x+"]["),f();const y=a.stack;a.stack=y.filter(function(w){return w!=="phrasing"}),f=a.enter("reference");const g=a.safe(a.associationId(n),{before:p,after:"]",...m.current()});return f(),a.stack=y,d(),s==="full"||!x||x!==g?p+=m.move(g+"]"):s==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function C5(){return"["}function fh(n){const r=n.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function T5(n){const r=fh(n),a=n.options.bulletOther;if(!a)return r==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+a+"`) to be different");return a}function _5(n){const r=n.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function n0(n){const r=n.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function A5(n,r,a,u){const s=a.enter("list"),d=a.bulletCurrent;let f=n.ordered?_5(a):fh(a);const m=n.ordered?f==="."?")":".":T5(a);let p=r&&a.bulletLastUsed?f===a.bulletLastUsed:!1;if(!n.ordered){const y=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&y&&(!y.children||!y.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(p=!0),n0(a)===f&&y){let g=-1;for(;++g-1?r.start:1)+(a.options.incrementListMarker===!1?0:r.children.indexOf(n))+d);let f=d.length+1;(s==="tab"||s==="mixed"&&(r&&r.type==="list"&&r.spread||n.spread))&&(f=Math.ceil(f/4)*4);const m=a.createTracker(u);m.move(d+" ".repeat(f-d.length)),m.shift(f);const p=a.enter("listItem"),x=a.indentLines(a.containerFlow(n,m.current()),y);return p(),x;function y(g,w,v){return w?(v?"":" ".repeat(f))+g:(v?d:d+" ".repeat(f-d.length))+g}}function M5(n,r,a,u){const s=a.enter("paragraph"),d=a.enter("phrasing"),f=a.containerPhrasing(n,u);return d(),s(),f}function O5(n,r,a,u){if(!n.children.some(function(m){return t5(m)}))return a.containerFlow(n,u);const d=a.enter("phrasing"),f=a.containerPhrasing(n,u);return d(),f}function R5(n){const r=n.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}dh.attention=l0;dh.peek=L5;function dh(n,r,a,u){const s=a.enter("phrasing"),d=oh(n,l0,a,a.createTracker(u)),f=gs([d],u.before,u.after);return s(),f}function l0(n,r){return{construct:"strong",markers:R5(r)==="*"?["*","_"]:["_","*"],sizes:[2]}}function L5(n,r,a){return a.options.strong||"*"}function U5(n,r,a,u){const s=r?r.children:[],d=a.indexStack[a.indexStack.length-1];return a.safe(n.value,{...u,afterNode:s[d+1],beforeNode:s[d-1]})}function B5(n){const r=n.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function H5(n,r,a){const u=(n0(a)+(a.options.ruleSpaces?" ":"")).repeat(B5(a));return a.options.ruleSpaces?u.slice(0,-1):u}const i0={blockquote:n5,break:Ay,code:o5,definition:c5,emphasis:ch,hardBreak:Ay,heading:w5,html:Zb,image:$b,imageReference:Jb,inlineCode:Pb,link:e0,linkReference:t0,list:A5,listItem:D5,paragraph:M5,root:O5,strong:dh,text:U5,thematicBreak:H5};function q5(){return{enter:{table:F5,tableData:Dy,tableHeader:Dy,tableRow:Y5},exit:{codeText:G5,table:V5,tableData:xd,tableHeader:xd,tableRow:xd}}}function F5(n){const r=n._align;this.enter({type:"table",align:r.map(function(a){return a==="none"?null:a}),children:[]},n),this.data.inTable=!0}function V5(n){this.exit(n),this.data.inTable=void 0}function Y5(n){this.enter({type:"tableRow",children:[]},n)}function xd(n){this.exit(n)}function Dy(n){this.enter({type:"tableCell",children:[]},n)}function G5(n){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,Q5));const a=this.stack[this.stack.length-1];a.type,a.value=r,this.exit(n)}function Q5(n,r){return r==="|"?r:n}function X5(n){const r=n||{},a=r.tableCellPadding,u=r.tablePipeAlign,s=r.stringLength,d=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` -`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:w,table:f,tableCell:p,tableRow:m}};function f(v,S,C,L){return x(y(v,C,L),v.align)}function m(v,S,C,L){const z=g(v,C,L),$=x([z]);return $.slice(0,$.indexOf(` -`))}function p(v,S,C,L){const z=C.enter("tableCell"),$=C.enter("phrasing"),I=C.containerPhrasing(v,{...L,before:d,after:d});return $(),z(),I}function x(v,S){return Wj(v,{align:S,alignDelimiters:u,padding:a,stringLength:s})}function y(v,S,C){const L=v.children;let z=-1;const $=[],I=S.enter("table");for(;++z0&&!a&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const c4={tokenize:y4,partial:!0};function f4(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:p4,continuation:{tokenize:g4},exit:x4}},text:{91:{name:"gfmFootnoteCall",tokenize:m4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:d4,resolveTo:h4}}}}function d4(n,r,a){const u=this;let s=u.events.length;const d=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let f;for(;s--;){const p=u.events[s][1];if(p.type==="labelImage"){f=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return m;function m(p){if(!f||!f._balanced)return a(p);const x=tl(u.sliceSerialize({start:f.end,end:u.now()}));return x.codePointAt(0)!==94||!d.includes(x.slice(1))?a(p):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(p),n.exit("gfmFootnoteCallLabelMarker"),r(p))}}function h4(n,r){let a=n.length;for(;a--;)if(n[a][1].type==="labelImage"&&n[a][0]==="enter"){n[a][1];break}n[a+1][1].type="data",n[a+3][1].type="gfmFootnoteCallLabelMarker";const u={type:"gfmFootnoteCall",start:Object.assign({},n[a+3][1].start),end:Object.assign({},n[n.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},n[a+3][1].end),end:Object.assign({},n[a+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const d={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},d.start),end:Object.assign({},d.end)},m=[n[a+1],n[a+2],["enter",u,r],n[a+3],n[a+4],["enter",s,r],["exit",s,r],["enter",d,r],["enter",f,r],["exit",f,r],["exit",d,r],n[n.length-2],n[n.length-1],["exit",u,r]];return n.splice(a,n.length-a+1,...m),n}function m4(n,r,a){const u=this,s=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let d=0,f;return m;function m(g){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),p}function p(g){return g!==94?a(g):(n.enter("gfmFootnoteCallMarker"),n.consume(g),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",x)}function x(g){if(d>999||g===93&&!f||g===null||g===91||mt(g))return a(g);if(g===93){n.exit("chunkString");const w=n.exit("gfmFootnoteCallString");return s.includes(tl(u.sliceSerialize(w)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),r):a(g)}return mt(g)||(f=!0),d++,n.consume(g),g===92?y:x}function y(g){return g===91||g===92||g===93?(n.consume(g),d++,x):x(g)}}function p4(n,r,a){const u=this,s=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let d,f=0,m;return p;function p(S){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(S),n.exit("gfmFootnoteDefinitionLabelMarker"),x}function x(S){return S===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(S),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",y):a(S)}function y(S){if(f>999||S===93&&!m||S===null||S===91||mt(S))return a(S);if(S===93){n.exit("chunkString");const C=n.exit("gfmFootnoteDefinitionLabelString");return d=tl(u.sliceSerialize(C)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(S),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),w}return mt(S)||(m=!0),f++,n.consume(S),S===92?g:y}function g(S){return S===91||S===92||S===93?(n.consume(S),f++,y):y(S)}function w(S){return S===58?(n.enter("definitionMarker"),n.consume(S),n.exit("definitionMarker"),s.includes(d)||s.push(d),et(n,v,"gfmFootnoteDefinitionWhitespace")):a(S)}function v(S){return r(S)}}function g4(n,r,a){return n.check(su,r,n.attempt(c4,r,a))}function x4(n){n.exit("gfmFootnoteDefinition")}function y4(n,r,a){const u=this;return et(n,s,"gfmFootnoteDefinitionIndent",5);function s(d){const f=u.events[u.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(d):a(d)}}function b4(n){let a=(n||{}).singleTilde;const u={name:"strikethrough",tokenize:d,resolveAll:s};return a==null&&(a=!0),{text:{126:u},insideSpan:{null:[u]},attentionMarkers:{null:[126]}};function s(f,m){let p=-1;for(;++p1?p(S):(f.consume(S),g++,v);if(g<2&&!a)return p(S);const L=f.exit("strikethroughSequenceTemporary"),z=wi(S);return L._open=!z||z===2&&!!C,L._close=!C||C===2&&!!z,m(S)}}}class v4{constructor(){this.map=[],this.index=new Map}add(r,a,u){w4(this,r,a,u)}consume(r){if(this.map.sort(function(d,f){return d[0]-f[0]}),this.map.length===0)return;let a=this.map.length;const u=[];for(;a>0;)a-=1,u.push(r.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),r.length=this.map[a][0];u.push(r.slice()),r.length=0;let s=u.pop();for(;s;){for(const d of s)r.push(d);s=u.pop()}this.map.length=0,this.index.clear()}}function w4(n,r,a,u){if(a===0&&u.length===0)return;const s=n.index.get(r);if(s){s[1]+=a,s[2].push(...u);return}const d=[r,a,u];n.map.push(d),n.index.set(r,d)}function k4(n,r){let a=!1;const u=[];for(;r-1;){const{type:ve}=u.events[ne][1];if(ve==="lineEnding"||ve==="linePrefix")ne--;else break}const V=ne>-1?u.events[ne][1].type:null,se=V==="tableHead"||V==="tableRow"?U:p;return se===U&&u.parser.lazy[u.now().line]?a(B):se(B)}function p(B){return n.enter("tableHead"),n.enter("tableRow"),x(B)}function x(B){return B===124||(f=!0,d+=1),y(B)}function y(B){return B===null?a(B):Te(B)?d>1?(d=0,u.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(B),n.exit("lineEnding"),v):a(B):Ve(B)?et(n,y,"whitespace")(B):(d+=1,f&&(f=!1,s+=1),B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),f=!0,y):(n.enter("data"),g(B)))}function g(B){return B===null||B===124||mt(B)?(n.exit("data"),y(B)):(n.consume(B),B===92?w:g)}function w(B){return B===92||B===124?(n.consume(B),g):g(B)}function v(B){return u.interrupt=!1,u.parser.lazy[u.now().line]?a(B):(n.enter("tableDelimiterRow"),f=!1,Ve(B)?et(n,S,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):S(B))}function S(B){return B===45||B===58?L(B):B===124?(f=!0,n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),C):ie(B)}function C(B){return Ve(B)?et(n,L,"whitespace")(B):L(B)}function L(B){return B===58?(d+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),z):B===45?(d+=1,z(B)):B===null||Te(B)?J(B):ie(B)}function z(B){return B===45?(n.enter("tableDelimiterFiller"),$(B)):ie(B)}function $(B){return B===45?(n.consume(B),$):B===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),I):(n.exit("tableDelimiterFiller"),I(B))}function I(B){return Ve(B)?et(n,J,"whitespace")(B):J(B)}function J(B){return B===124?S(B):B===null||Te(B)?!f||s!==d?ie(B):(n.exit("tableDelimiterRow"),n.exit("tableHead"),r(B)):ie(B)}function ie(B){return a(B)}function U(B){return n.enter("tableRow"),R(B)}function R(B){return B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),R):B===null||Te(B)?(n.exit("tableRow"),r(B)):Ve(B)?et(n,R,"whitespace")(B):(n.enter("data"),Q(B))}function Q(B){return B===null||B===124||mt(B)?(n.exit("data"),R(B)):(n.consume(B),B===92?fe:Q)}function fe(B){return B===92||B===124?(n.consume(B),Q):Q(B)}}function E4(n,r){let a=-1,u=!0,s=0,d=[0,0,0,0],f=[0,0,0,0],m=!1,p=0,x,y,g;const w=new v4;for(;++aa[2]+1){const S=a[2]+1,C=a[3]-a[2]-1;n.add(S,C,[])}}n.add(a[3]+1,0,[["exit",g,r]])}return s!==void 0&&(d.end=Object.assign({},Ir(r.events,s)),n.add(s,0,[["exit",d,r]]),d=void 0),d}function Oy(n,r,a,u,s){const d=[],f=Ir(r.events,a);s&&(s.end=Object.assign({},f),d.push(["exit",s,r])),u.end=Object.assign({},f),d.push(["exit",u,r]),n.add(a+1,0,d)}function Ir(n,r){const a=n[r],u=a[0]==="enter"?"start":"end";return a[1][u]}const j4={name:"tasklistCheck",tokenize:T4};function C4(){return{text:{91:j4}}}function T4(n,r,a){const u=this;return s;function s(p){return u.previous!==null||!u._gfmTasklistFirstContentOfListItem?a(p):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(p),n.exit("taskListCheckMarker"),d)}function d(p){return mt(p)?(n.enter("taskListCheckValueUnchecked"),n.consume(p),n.exit("taskListCheckValueUnchecked"),f):p===88||p===120?(n.enter("taskListCheckValueChecked"),n.consume(p),n.exit("taskListCheckValueChecked"),f):a(p)}function f(p){return p===93?(n.enter("taskListCheckMarker"),n.consume(p),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),m):a(p)}function m(p){return Te(p)?r(p):Ve(p)?n.check({tokenize:_4},r,a)(p):a(p)}}function _4(n,r,a){return et(n,u,"whitespace");function u(s){return s===null?a(s):r(s)}}function A4(n){return yb([t4(),f4(),b4(n),S4(),C4()])}const z4={};function D4(n){const r=this,a=n||z4,u=r.data(),s=u.micromarkExtensions||(u.micromarkExtensions=[]),d=u.fromMarkdownExtensions||(u.fromMarkdownExtensions=[]),f=u.toMarkdownExtensions||(u.toMarkdownExtensions=[]);s.push(A4(a)),d.push(J5()),f.push(P5(a))}function M4(n){return n.replace(/\\n/g,` -`).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\'/g,"'").replace(/\\\\/g,"\\")}const O4={h1:({children:n})=>h.jsx("h3",{className:"mt-3 mb-1.5 text-base font-bold text-ink first:mt-0",children:n}),h2:({children:n})=>h.jsx("h4",{className:"mt-3 mb-1 text-sm font-semibold text-ink first:mt-0",children:n}),h3:({children:n})=>h.jsx("h5",{className:"mt-2 mb-1 text-xs font-semibold text-ink first:mt-0",children:n}),p:({children:n})=>h.jsx("p",{className:"my-1.5 leading-relaxed first:mt-0 last:mb-0",children:n}),strong:({children:n})=>h.jsx("strong",{className:"font-semibold text-ink",children:n}),em:({children:n})=>h.jsx("em",{className:"italic text-ink-secondary",children:n}),del:({children:n})=>h.jsx("del",{className:"text-ink-muted line-through",children:n}),a:({children:n,href:r})=>h.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-chip-indigo-text underline underline-offset-2 hover:text-ink",children:n}),code:({children:n,className:r})=>h.jsx("code",{className:`break-words rounded bg-elevated px-1 py-0.5 font-mono text-chip-indigo-text whitespace-pre-wrap ${r??""}`,children:n}),pre:({children:n})=>h.jsx("pre",{className:"my-2 overflow-x-auto rounded-lg border border-line bg-elevated p-3 font-mono text-xs text-ink [&_code]:bg-transparent [&_code]:px-0 [&_code]:py-0 [&_code]:text-inherit",children:n}),ul:({children:n})=>h.jsx("ul",{className:"my-1.5 list-disc space-y-0.5 pl-5",children:n}),ol:({children:n})=>h.jsx("ol",{className:"my-1.5 list-decimal space-y-0.5 pl-5",children:n}),li:({children:n})=>h.jsx("li",{className:"leading-relaxed",children:n}),blockquote:({children:n})=>h.jsx("blockquote",{className:"my-2 border-l-2 border-line-strong pl-3 text-ink-secondary italic",children:n}),table:({children:n})=>h.jsx("div",{className:"my-2 overflow-x-auto",children:h.jsx("table",{className:"w-full border-collapse text-xs",children:n})}),th:({children:n})=>h.jsx("th",{className:"border border-line bg-elevated px-2 py-1 text-left font-semibold",children:n}),td:({children:n})=>h.jsx("td",{className:"border border-line px-2 py-1 align-top",children:n}),hr:()=>h.jsx("hr",{className:"my-3 border-line"}),img:({alt:n,src:r,title:a})=>h.jsx("img",{src:r,alt:n,title:a,loading:"lazy",referrerPolicy:"no-referrer",className:"my-2 max-w-full rounded-lg border border-line"})};function Jo({text:n}){return n?h.jsx(sj,{remarkPlugins:[D4,vj],components:O4,children:M4(n)}):null}function h0(n){return n==="completed"||n==="aborted"||n==="failed"}function tu({label:n}){return h.jsx("kbd",{"aria-hidden":"true",className:"ml-1.5 inline-block rounded border border-line/60 bg-elevated/60 px-1 py-px font-mono text-[10px] font-normal leading-none opacity-90",children:n})}function Ry(n){!n||h0(n.status)||S2(n.session_id).catch(()=>{})}const R4={running:"running",completed:"done",skipped:"skipped",failed:"failed",pending:"pending"};function Po({text:n}){const[r,a]=_.useState(!1),u=_.useRef(void 0);_.useEffect(()=>()=>window.clearTimeout(u.current),[]);const s=async()=>{try{await navigator.clipboard.writeText(n),a(!0),window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!1),1500)}catch{}};return h.jsx("button",{type:"button",onClick:s,"aria-label":r?"Copied":"Copy content",title:r?"Copied!":"Copy content",className:"absolute right-2 top-2 rounded-md p-1.5 text-ink-muted hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:r?h.jsx(vi,{className:"h-3.5 w-3.5"}):h.jsx(An,{className:"h-3.5 w-3.5"})})}function L4({isOpen:n,onClose:r,directory:a,filename:u,release:s,args:d,onFinished:f}){var Ge,M;const[m,p]=_.useState(null),[x,y]=_.useState(!1),[g,w]=_.useState(null),[v,S]=_.useState(null),[C,L]=_.useState(!1),[z,$]=_.useState(0),I=_.useRef(null),J=_.useRef(!1),ie=_.useRef(null),U=_.useRef(!1);_.useEffect(()=>{if(!n||!a||!u){p(null),w(null),L(!1),S(null),U.current=!1;return}let E=!0;return y(!0),w(null),L(!1),S(null),w2({directory:a,filename:u,release:s,args:d}).then(Y=>{E&&(p(Y),y(!1),(Y.status==="completed"||Y.status==="aborted"||Y.status==="failed")&&(f==null||f(Y.status,Y.final_message||"")))}).catch(Y=>{E&&((Y==null?void 0:Y.status)===404&&L(!0),w(Y.message||"Failed to start workflow"),y(!1))}),()=>{E=!1}},[n,a,u,s,d,z]);const R=async E=>{if(!(!m||J.current)){J.current=!0,y(!0);try{const Y=await k2(m.session_id,E);p(Y),(Y.status==="completed"||Y.status==="aborted"||Y.status==="failed")&&(f==null||f(Y.status,Y.final_message||""))}catch(Y){(Y==null?void 0:Y.status)===404?(L(!0),w(Y.message||"Workflow session on the server has expired.")):w(Y.message||"Failed to process workflow response")}finally{J.current=!1,y(!1)}}},Q=_.useRef(m);Q.current=m;const fe=_.useRef(R);fe.current=R;const B=_.useRef(v);B.current=v;const ne=_.useRef([]),V=(E,Y)=>{var je,ye;if(E.key!=="ArrowDown"&&E.key!=="ArrowUp"&&E.key!=="Home"&&E.key!=="End")return;E.preventDefault();const oe=((je=Q.current)==null?void 0:je.steps.length)??0;if(oe===0)return;const de=E.key==="ArrowDown"?(Y+1)%oe:E.key==="ArrowUp"?(Y-1+oe)%oe:E.key==="Home"?0:oe-1;S(de),(ye=ne.current[de])==null||ye.focus()};_.useEffect(()=>()=>Ry(Q.current),[]);const se=()=>{U.current||(U.current=!0,Ry(Q.current),r())},ve=()=>{p(null),w(null),L(!1),S(null),U.current=!1,$(E=>E+1)},ae=Wr({isOpen:n,onClose:se,dialogRef:I,initialFocusRef:ie});if(_.useEffect(()=>{if(!n)return;const E=Y=>{var Se,Rt,Bt;if(Y.key==="Escape"){Y.preventDefault(),se();return}const oe=Q.current;if(!oe)return;if(h0(oe.status)){Y.key==="Enter"&&!Y.repeat&&!Y.ctrlKey&&!Y.metaKey&&!Y.altKey&&!J.current&&((Se=Y.target)==null?void 0:Se.tagName)!=="BUTTON"&&((Rt=document.activeElement)==null?void 0:Rt.tagName)!=="BUTTON"&&(Y.preventDefault(),se());return}if(J.current||Y.repeat||Y.ctrlKey||Y.metaKey||Y.altKey)return;const de=Y.target;if((de==null?void 0:de.tagName)==="INPUT"||(de==null?void 0:de.tagName)==="TEXTAREA"||de!=null&&de.isContentEditable)return;const je=B.current,ye=je===null||je===oe.current_index,_e=oe.status==="waiting_ask"?"yes":oe.status==="waiting_notify"||oe.status==="waiting_notice"?"ack":null;if(!ye||_e===null)return;if(Y.key==="Enter"){const Gt=Y.target;if((Gt==null?void 0:Gt.tagName)==="BUTTON"||((Bt=document.activeElement)==null?void 0:Bt.tagName)==="BUTTON")return;Y.preventDefault(),fe.current(_e);return}if(oe.status!=="waiting_ask")return;const pe=Y.key.toLowerCase();pe==="y"?(Y.preventDefault(),fe.current("yes")):pe==="s"?(Y.preventDefault(),fe.current("skip")):pe==="n"&&(Y.preventDefault(),fe.current("no"))};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[n,r]),_.useEffect(()=>{if(!n||!m)return;const E=requestAnimationFrame(()=>{var Y;return(Y=ie.current)==null?void 0:Y.focus()});return()=>cancelAnimationFrame(E)},[n,m==null?void 0:m.status]),!n)return null;const A=v!==null?m==null?void 0:m.steps[v]:m==null?void 0:m.steps[m.current_index],W=(m==null?void 0:m.status)==="completed"||(m==null?void 0:m.status)==="aborted"||(m==null?void 0:m.status)==="failed",le=!!m&&!W&&!C&&(((Ge=m.status)==null?void 0:Ge.startsWith("waiting"))??!1),re=(((M=m==null?void 0:m.steps[(m==null?void 0:m.current_index)??-1])==null?void 0:M.phase)??"pre")==="post",qe=!C&&(v===null||v===(m==null?void 0:m.current_index))&&(A!=null&&A.command)&&((m==null?void 0:m.status)==="waiting_notify"||(m==null?void 0:m.status)==="waiting_notice"||(m==null?void 0:m.status)==="waiting_ask")?h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Command:"}),h.jsxs("div",{className:"relative rounded-lg border border-line bg-surface-strong p-4 pr-10 font-mono text-xs text-ink leading-relaxed",children:[h.jsx(Po,{text:A.command}),A.command]})]}):null;return h.jsx("div",{ref:I,role:"dialog","aria-modal":"true","aria-labelledby":"workflow-runner-title",onKeyDown:ae,className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-xs",children:h.jsxs("div",{className:"animate-modal-in flex h-[80vh] w-full max-w-5xl flex-col rounded-xl border border-frame-line glass-panel overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-line px-5 py-3.5 bg-surface-strong/30 shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-2.5",children:[h.jsx("span",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-chip-indigo-bg text-chip-indigo-text",children:h.jsx(eb,{className:"h-4 w-4"})}),h.jsxs("div",{children:[h.jsx("h2",{id:"workflow-runner-title",className:"text-sm font-semibold text-ink",children:"Launch Workflow Engine"}),h.jsxs("p",{className:"text-xs text-ink-muted",children:[u," ",m!=null&&m.pattern?`• Pattern: ${m.pattern}`:""]})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[m&&!W&&!C&&h.jsxs("button",{type:"button",disabled:!le||x,onClick:()=>R("bypass"),title:re?"Skip the remaining post-launch steps":"Skip the remaining steps and launch with the OS default app",className:"btn inline-flex items-center gap-1.5 rounded-md border border-line bg-surface px-3 py-1.5 text-xs font-medium text-status-warning-text hover:bg-status-warning-bg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 disabled:cursor-not-allowed disabled:opacity-40",children:[h.jsx(qw,{className:"h-3.5 w-3.5"}),re?"Skip rest":"Launch now"]}),h.jsx("button",{type:"button",onClick:se,className:"rounded-md p-1.5 text-ink-muted hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:h.jsx(nl,{className:"h-4 w-4"})})]})]}),h.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[h.jsxs("div",{className:"w-72 border-r border-line bg-surface-strong/20 p-4 overflow-y-auto flex flex-col gap-2 shrink-0",children:[h.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-ink-muted px-1 mb-1",children:"Workflow Steps (Click to inspect)"}),m&&m.steps.length>0?h.jsx("ul",{role:"list",className:"flex flex-col gap-2",children:m.steps.map((E,Y)=>{const oe=m.current_index===Y&&!W,de=v===Y||v===null&&oe,je=R4[E.status];return h.jsx("li",{children:h.jsxs("button",{ref:ye=>{ne.current[Y]=ye},type:"button",tabIndex:de?0:-1,"aria-current":de?"step":void 0,onKeyDown:ye=>V(ye,Y),onClick:()=>S(Y),className:`flex items-start text-left gap-2.5 rounded-lg border px-3 py-2.5 transition-colors cursor-pointer w-full ${de?"border-chip-indigo-border bg-chip-indigo-bg shadow-xs ring-1 ring-chip-indigo-border/40":"border-line/60 bg-surface/60 hover:bg-elevated/80"}`,children:[h.jsxs("div",{className:"mt-0.5 shrink-0",children:[E.status==="running"&&h.jsx(Wi,{className:"h-4 w-4 animate-spin text-chip-indigo-text"}),E.status==="completed"&&h.jsx(Mx,{className:"h-4 w-4 text-status-success-text"}),E.status==="skipped"&&h.jsx(dw,{className:"h-4 w-4 text-status-warning-text"}),E.status==="failed"&&h.jsx(lu,{className:"h-4 w-4 text-status-danger-text"}),E.status==="pending"&&h.jsx("div",{className:"h-4 w-4 rounded-full border border-line-strong flex items-center justify-center text-[10px] text-ink-faint font-mono",children:E.index})]}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"font-mono text-[11px] font-bold uppercase text-chip-indigo-text",children:E.action}),h.jsxs("span",{className:"text-[10px] font-mono text-ink-faint",children:["#",E.index," · ",je]})]}),h.jsx("p",{className:"truncate font-mono text-[11px] text-ink-secondary mt-0.5",title:E.command,children:E.message?E.message.split(` -`)[0]:E.command}),E.note&&h.jsx("p",{className:"mt-1 text-[10px] text-ink-faint italic",children:E.note})]})]})},E.index)})}):h.jsx("div",{className:"p-4 text-center text-xs text-ink-faint",children:g||C?"Session unavailable — see the error panel.":"Loading steps..."})]}),h.jsxs("div",{className:"flex-1 flex flex-col bg-app",children:[h.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-6",children:h.jsx("div",{className:"space-y-6",children:h.jsxs("div",{className:"rounded-xl border border-line bg-surface p-5 shadow-xs space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"rounded bg-chip-indigo-bg px-2 py-0.5 font-mono text-xs font-semibold uppercase text-chip-indigo-text",children:(A==null?void 0:A.action)||(m==null?void 0:m.status)}),h.jsx("span",{className:"text-xs text-ink-muted",children:A?`Step ${A.index} of ${m==null?void 0:m.steps.length}`:"Status"}),v!==null&&v!==(m==null?void 0:m.current_index)&&h.jsx("button",{type:"button",onClick:()=>S(null),className:"text-[11px] text-chip-indigo-text hover:underline ml-2",children:"(Return to active step)"})]}),x&&h.jsx(Wi,{className:"h-4 w-4 animate-spin text-chip-indigo-text"})]}),h.jsxs("div",{className:"space-y-3 text-xs text-ink font-sans leading-relaxed",children:[(v===null||v===(m==null?void 0:m.current_index))&&(m==null?void 0:m.status)==="waiting_notify"&&m.notify_message&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Notification Message:"}),h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-ink",children:h.jsx(Jo,{text:m.notify_message})}),qe]}),(v===null||v===(m==null?void 0:m.current_index))&&(m==null?void 0:m.status)==="waiting_notice"&&m.notice_message&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Notice:"}),h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-ink",children:h.jsx(Jo,{text:m.notice_message})}),qe,h.jsx("p",{className:"text-[11px] text-ink-faint",children:"The command will run when you continue."})]}),(v===null||v===(m==null?void 0:m.current_index))&&(m==null?void 0:m.status)==="waiting_ask"&&m.ask_prompt&&h.jsxs("div",{className:"space-y-2",children:[m.ask_message&&h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-ink",children:h.jsx(Jo,{text:m.ask_message})}),h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-status-warning-text",children:"Confirmation Prompt:"}),h.jsx("div",{className:"rounded-lg border border-status-warning-border bg-status-warning-bg p-4 text-sm font-medium text-ink",children:m.ask_prompt}),qe]}),W&&v===null&&h.jsxs("div",{className:`rounded-xl border p-8 text-center space-y-4 ${(m==null?void 0:m.status)==="completed"?"border-status-success-border bg-status-success-bg text-status-success-text":"border-status-danger-border bg-status-danger-bg text-status-danger-text"}`,children:[h.jsx("div",{className:"inline-flex h-12 w-12 items-center justify-center rounded-full bg-surface/50 mx-auto",children:(m==null?void 0:m.status)==="completed"?h.jsx(Mx,{className:"h-6 w-6 text-status-success-text"}):h.jsx(lu,{className:"h-6 w-6 text-status-danger-text"})}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("h3",{className:"text-base font-bold",children:(m==null?void 0:m.status)==="completed"?"Workflow Finished":"Workflow Terminated"}),h.jsx("p",{className:"text-xs text-ink-secondary max-w-md mx-auto",children:(m==null?void 0:m.final_message)||"The launch sequence has ended."})]}),h.jsx("div",{className:"pt-2",children:h.jsx("button",{type:"button",onClick:r,className:"btn btn-primary px-8 py-2.5 font-bold shadow-lg",children:"Close Engine Runner"})})]}),W&&v===null&&(m==null?void 0:m.last_output)&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Command Output:"}),h.jsxs("div",{className:"relative",children:[h.jsx(Po,{text:m.last_output}),h.jsx("pre",{className:"max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-line bg-surface-strong p-4 font-mono text-xs text-ink",children:m.last_output})]})]}),!C&&!(W&&v===null)&&!((v===null||v===(m==null?void 0:m.current_index))&&((m==null?void 0:m.status)==="waiting_notify"||(m==null?void 0:m.status)==="waiting_ask"||(m==null?void 0:m.status)==="waiting_notice"))&&h.jsxs("div",{className:"space-y-4",children:[(A==null?void 0:A.message)&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Message:"}),h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-xs text-ink",children:h.jsx(Jo,{text:A.message})})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Command:"}),h.jsx("div",{className:"relative rounded-lg border border-line bg-surface-strong p-4 font-mono text-xs text-ink leading-relaxed",children:A!=null&&A.command?h.jsxs(h.Fragment,{children:[h.jsx(Po,{text:A.command}),h.jsx("span",{className:"block pr-8",children:A.command})]}):"Waiting..."})]}),(A==null?void 0:A.output)&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Output:"}),h.jsxs("div",{className:"relative",children:[h.jsx(Po,{text:A.output}),h.jsx("pre",{className:"max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-line bg-surface-strong p-4 font-mono text-xs text-ink",children:A.output})]})]}),(A==null?void 0:A.ask)&&h.jsxs("div",{className:"rounded-lg border border-status-warning-border bg-status-warning-bg p-3 text-xs text-status-warning-text",children:[h.jsx("span",{className:"font-semibold",children:"Workflow Guard:"})," ",A.ask]}),(A==null?void 0:A.note)&&h.jsxs("div",{className:"rounded-lg border border-line bg-surface-strong p-3 text-xs text-ink-muted italic",children:[h.jsx("span",{className:"font-semibold text-ink-secondary not-italic uppercase text-[10px]",children:"Log:"})," ",A.note]})]})]})]})})}),(g||C)&&h.jsx("div",{className:"shrink-0 px-6 pt-3",children:h.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-status-danger-border bg-status-danger-bg p-3 text-xs text-status-danger-text",children:[h.jsx(lu,{className:"mt-0.5 h-4 w-4 shrink-0"}),h.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[h.jsx("p",{children:C?"Workflow session on the server has expired or ended.":g}),C?h.jsxs("div",{className:"space-y-2",children:[g&&h.jsxs("details",{className:"text-ink-muted",children:[h.jsx("summary",{className:"cursor-pointer select-none text-[11px] underline",children:"Raw error (for bug reports)"}),h.jsx("pre",{className:"mt-1 overflow-x-auto whitespace-pre-wrap break-words font-mono text-[11px]",children:g})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{type:"button",onClick:ve,className:"btn btn-primary px-4 py-1.5 text-xs font-semibold",children:"Restart workflow"}),h.jsx("button",{type:"button",onClick:se,className:"btn rounded-md border-line bg-surface px-4 py-1.5 text-xs",children:"Close"})]})]}):null]})]})}),h.jsxs("div",{className:"shrink-0 px-6 pt-4 pb-4 border-t border-line flex items-center justify-between bg-app",children:[h.jsx("div",{className:"text-xs text-ink-muted","aria-live":"polite",children:C?"Session unavailable — restart or close above.":(m==null?void 0:m.status)==="waiting_ask"&&(v===null||v===m.current_index)?"Action required to proceed:":(m==null?void 0:m.status)==="waiting_notify"&&(v===null||v===m.current_index)?"Acknowledge message to proceed:":(m==null?void 0:m.status)==="waiting_notice"&&(v===null||v===m.current_index)?"Continue to run the command:":W?"Session terminated.":"Step in progress..."}),h.jsxs("div",{className:"flex items-center gap-2",children:[!C&&(m==null?void 0:m.status)==="waiting_notice"&&(v===null||v===m.current_index)&&h.jsxs("button",{type:"button",ref:ie,disabled:x,onClick:()=>R("ack"),className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:["Run Command",h.jsx(tu,{label:"↵"})]}),!C&&(m==null?void 0:m.status)==="waiting_notify"&&(v===null||v===m.current_index)&&h.jsxs("button",{type:"button",ref:ie,disabled:x,onClick:()=>R("ack"),className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:["Continue Workflow",h.jsx(tu,{label:"↵"})]}),!C&&(m==null?void 0:m.status)==="waiting_ask"&&(v===null||v===m.current_index)&&h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",disabled:x,onClick:()=>R("no"),className:"btn rounded-md border-line bg-surface px-4 py-2 text-status-danger-text hover:bg-status-danger-bg",children:["Abort Launch",h.jsx(tu,{label:"N"})]}),h.jsxs("button",{type:"button",disabled:x,onClick:()=>R("skip"),className:"btn rounded-md border-line bg-surface px-4 py-2 text-status-warning-text hover:bg-status-warning-bg",children:["Skip Step",h.jsx(tu,{label:"S"})]}),h.jsxs("button",{type:"button",ref:ie,disabled:x,onClick:()=>R("yes"),className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:["Execute Step",h.jsx(tu,{label:"Y"})]})]}),W&&h.jsx("button",{type:"button",ref:ie,onClick:r,className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:"Close Runner"})]})]})]})]})]})})}function Ly({isOpen:n,title:r,message:a,confirmLabel:u="Confirm",cancelLabel:s="Cancel",danger:d=!1,onConfirm:f,onCancel:m}){const p=_.useRef(null),x=_.useRef(null),y=Wr({isOpen:n,onClose:m,dialogRef:p,initialFocusRef:x});return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",onClick:m,children:h.jsxs("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",onKeyDown:y,onClick:g=>g.stopPropagation(),className:"animate-modal-in w-[400px] max-w-full rounded-2xl border border-frame-line glass-panel p-5",children:[h.jsxs("div",{className:"mb-3 flex items-center gap-2.5",children:[h.jsx("span",{className:`grid h-9 w-9 shrink-0 place-items-center rounded-lg ${d?"bg-status-danger-bg text-status-danger-text":"bg-chip-indigo-bg text-chip-indigo-text"}`,children:h.jsx(Wy,{className:"h-5 w-5"})}),h.jsx("h2",{id:"confirm-dialog-title",className:"text-sm font-semibold text-ink",children:r})]}),h.jsx("p",{className:"mb-5 whitespace-pre-line text-xs text-ink-secondary",children:a}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx("button",{ref:x,type:"button",onClick:m,className:"min-h-9 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:s}),h.jsx("button",{type:"button",onClick:f,className:`min-h-9 rounded-lg border px-4 text-sm font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400 ${d?"border-status-danger-border bg-status-danger-bg/30 text-status-danger-text hover:bg-status-danger-bg/60":"btn-primary border-transparent bg-indigo-600 text-white hover:bg-indigo-500"}`,children:u})]})]})}):null}const U4=";",Uy="=";function B4(n){const r=n.trim().toLowerCase();return r==="extension"||r==="file_ext"||r==="filetype"?"ext":r==="directory"||r==="path"||r==="folder"?"dir":r==="recurse"||r==="recursive_search"?"recursive":r==="filter_text"||r==="query"||r==="search"?"filter":r}function By(n){const r=n.trim();if(!r.includes(Uy))return{values:{filter:r},isPlainFilter:!0};const a={};for(const u of r.split(U4)){const s=u.trim();if(!s)continue;const d=s.indexOf(Uy);if(d===-1)continue;const f=B4(s.slice(0,d)),m=s.slice(d+1).trim();switch(f){case"filter":a.filter=m;break;case"ext":a.ext=m;break;case"recursive":a.recursive=Hy(m,!0);break;case"dir":a.dir=m;break;case"scan":a.scan=Hy(m,!1);break}}return{values:a,isPlainFilter:!1}}function Hy(n,r){const a=n.toLowerCase();return["0","false","no","off"].includes(a)?!1:["1","true","yes","on"].includes(a)?!0:r}function nu(n){return/[",\n\r]/.test(n)?`"${n.replace(/"/g,'""')}"`:n}function H4(n,r,a,u){var p,x;const s=[],f=[["Exported",new Date().toISOString()],["App Version",(a==null?void 0:a.release)??"unknown"],["Config File",(a==null?void 0:a.config_path)??"none"],["Config Exists",String((a==null?void 0:a.config_exists)??!1)],["Directory",(a==null?void 0:a.active_directory)??""],["Extensions",((p=a==null?void 0:a.extensions)==null?void 0:p.join(" | "))??""],["Filter Text",u??((x=a==null?void 0:a.filters)==null?void 0:x[0])??""],["Recursive",String((a==null?void 0:a.recursive_search)??!0)],["Title",(a==null?void 0:a.title)??""],["Release",(a==null?void 0:a.release)??""]];for(const[y,g]of f)s.push(`${nu(y)},${nu(g)}`);s.push("");const m=r.length>0?r:["filename","path","rel_path"];s.push(m.map(nu).join(","));for(const y of n){const g=m.map(w=>w in y?nu(String(y[w]??"")):nu(y.column_values[w]??""));s.push(g.join(","))}return s.join(`\r -`)}const q4=120,qy=800,F4=4e3,Fy=20;function V4(){const[n,r]=_.useState("dark"),[a,u]=_.useState(null),[s,d]=_.useState(null),[f,m]=_.useState(""),[p,x]=_.useState(""),[y,g]=_.useState(""),[w,v]=_.useState(!0),[S,C]=_.useState([]),[L,z]=_.useState(0),[$,I]=_.useState(!1),[J,ie]=_.useState(!1),[U,R]=_.useState(null),[Q,fe]=_.useState(!1),[B,ne]=_.useState(null),[V,se]=_.useState(0),[ve,ae]=_.useState(!1),A=_.useRef(0),W=_.useRef(null),le=_.useRef(null),[re,N]=_.useState(""),[qe,Ge]=_.useState(null),[M,E]=_.useState(!1),[Y,oe]=_.useState(null),[de,je]=_.useState(!1),[ye,_e]=_.useState("en"),[pe,Se]=_.useState(!1),[Rt,Bt]=_.useState(!1),[Gt,St]=_.useState(!1),[nt,Je]=_.useState(null),[en,bn]=_.useState(null),[tn,Ht]=_.useState(!1),[ge,Me]=_.useState(!1),[Le,lt]=_.useState(null),[K,ue]=_.useState(null),[ke,Ce]=_.useState(!1),ft=_.useRef(""),[it,Tt]=_.useState(!1),[nn,zn]=_.useState(void 0),[Dn,Mn]=_.useState(!1),[ll,Nt]=_.useState(null),[Et,Gn]=_.useState(0),Qt=_.useRef(null),il=_.useRef(null),he=(D,T="info")=>{D&&(oe({message:D,kind:T}),il.current&&clearTimeout(il.current),il.current=setTimeout(()=>oe(null),T==="error"?1e4:3500))},fu=()=>{il.current&&clearTimeout(il.current),oe(null)},xs=D=>{lt(D)},vn=()=>{var T;le.current&&(clearTimeout(le.current),le.current=null),(T=W.current)==null||T.abort(),W.current=new AbortController;const D=++A.current;return ae(!0),ie(!1),D},pt=D=>D===A.current,gt=D=>{pt(D)&&ae(!1)},jt=_.useRef(null);_.useEffect(()=>{if(!y.trim()){N("");return}const D=window.setTimeout(()=>N(y),q4);return()=>window.clearTimeout(D)},[y]);const Ke=_.useMemo(()=>re.trim()===""?S:S.filter(D=>Sk(D.rel_path,re)),[S,re]),ys=y.trim()&&S.length{const D=jt.current,T=D?Ke.findIndex(P=>P.path===D):-1;if(T>=0){se(P=>T!==P?T:P);return}se(P=>Math.min(P,Math.max(0,Ke.length-1)))},[Ke]);const du=async(D,T=B)=>{var we;const P=await Pf({offset:0,limit:ed,sort_by:T==null?void 0:T.column,sort_dir:T==null?void 0:T.direction,signal:(we=W.current)==null?void 0:we.signal});return pt(D)?(C(P.items),z(P.count),I(!0),!0):!1},On=async(D,T)=>{var P;return!pt(D)||(await Ex(T,(P=W.current)==null?void 0:P.signal),!pt(D)||!await du(D))?!1:(jt.current=null,se(0),!0)},lr=async()=>{if(J||S.length>=L)return;const D=A.current;ie(!0);try{const T=await Pf({offset:S.length,limit:ed,sort_by:B==null?void 0:B.column,sort_dir:B==null?void 0:B.direction});if(!pt(D))return;const P=new Set(S.map(we=>we.path||we.filename));C(we=>[...we,...T.items.filter(Oe=>!P.has(Oe.path||Oe.filename))]),z(T.count)}catch{he("Couldn't load more results — scroll to try again.","error")}finally{pt(D)&&ie(!1)}},Si=async()=>{if(de)return;je(!0),he("Reloading configuration...");const D=vn();try{const T=await Vo();u(T);const P=await d2();d(P),r(zx(P.theme));const we=P.active_directory||f,Oe=P.extensions[0]??"",Ye=P.filters[0]??"";we&&m(we),x(Oe),g(Ye),v(P.recursive_search),P.reloaded===!1?he(`Config file not found: ${P.config_path||"(unknown path)"} — kept current configuration.`,"error"):he("Configuration reloaded."),we&&await On(D,{directory:we,extension:Oe,filter_text:Ye,recursive:P.recursive_search})}catch(T){he(`Failed to reload configuration: ${T.message}`,"error")}finally{je(!1),gt(D)}},ql=async D=>{const T=vn();d(D),r(zx(D.theme));const P=D.active_directory||f||(D.directories[0]??""),we=D.extensions[0]??"",Oe=D.filters[0]??"";if(P&&m(P),x(we),g(Oe),v(D.recursive_search),D.session_trial||he(D.config_exists?`Loaded config: ${D.config_path}`:"Starter configuration created."),P)try{await On(T,{directory:P,extension:we,filter_text:Oe,recursive:D.recursive_search})}catch(Ye){he(`Scan failed after config load: ${Ye.message}`,"error")}finally{gt(T)}else gt(T)},[wl,ir]=_.useState(!1),kl=_.useRef(Wo()),Ni=D=>{kl.current=D,ir(D.overlayVisible)},na=_.useRef(()=>{}),hu=async D=>{try{const T=await D.text(),P=await f2(D.name,T);await ql(P),he(`Session config applied: ${D.name}`)}catch(T){he(T.message||"Failed to apply dropped configuration","error")}};na.current=D=>{hu(D)};const Ei=_.useRef(0),Fl=_.useRef(async()=>{});_.useEffect(()=>{Fl.current=async()=>{const D=await Sx();await ql(D)}}),_.useEffect(()=>{const D=async()=>{let P=[];try{P=(await a2(Ei.current)).events}catch{return}for(const we of P){if(Ei.current=Math.max(Ei.current,we.id),we.config_applied)try{await Fl.current()}catch{}he(we.message)}},T=setInterval(()=>void D(),F4);return()=>clearInterval(T)},[]),_.useEffect(()=>{const D=Ye=>{var qt;return Array.from(((qt=Ye.dataTransfer)==null?void 0:qt.types)??[]).includes("Files")},T=Ye=>{Ni(Ax(kl.current,"enter",D(Ye)))},P=Ye=>{D(Ye)&&Ye.preventDefault()},we=Ye=>{Ni(Ax(kl.current,"leave",D(Ye)))},Oe=Ye=>{var Qe;Ye.preventDefault(),Ni(Wo());const qt=Array.from(((Qe=Ye.dataTransfer)==null?void 0:Qe.files)??[]),Re=j2(qt);if(!Re){qt.length>0&&he("Not a ProFiles configuration file.","error");return}na.current(Re)};return window.addEventListener("dragenter",T),window.addEventListener("dragover",P),window.addEventListener("dragleave",we),window.addEventListener("drop",Oe),()=>{window.removeEventListener("dragenter",T),window.removeEventListener("dragover",P),window.removeEventListener("dragleave",we),window.removeEventListener("drop",Oe)}},[]);const bs=()=>{Se(!0)},mu=async D=>{const T=vn();Se(!1),m(D),he(`Directory selected: ${D}`);let P;try{P=await Nx(D),d(P)}catch(Ye){console.error("select-directory failed:",Ye)}if(!pt(T))return;const we=P!=null&&P.extensions.includes(p)?p:(P==null?void 0:P.extensions[0])??p,Oe=P!=null&&P.filters.includes(y)?y:(P==null?void 0:P.filters[0])??y;x(we),g(Oe);try{await On(T,{directory:D,extension:we,filter_text:Oe,recursive:w})}catch(Ye){pt(T)&&he(`Scan failed: ${Ye.message}`,"error")}finally{gt(T)}},pu=async(D,T)=>{if(!pt(T))return;const P=D.theme==="auto"?"dark":D.theme==="light"?"light":"dark";r(P);try{localStorage.setItem("profiles-theme",P)}catch{}d(D);const we=D.active_directory||(D.directories.length>0?D.directories[0]:""),Oe=D.extensions.length>0?D.extensions[0]:"",Ye=D.filters.length>0?D.filters[0]:"";if(we&&m(we),Oe&&x(Oe),D.recursive_search!==void 0&&v(D.recursive_search),Ye&&g(Ye),D.config_exists||Bt(!0),we)try{await On(T,{directory:we,extension:Oe,filter_text:Ye,recursive:D.recursive_search})}catch(qt){pt(T)&&he(`Initial scan failed: ${qt.message}`,"error")}},la=async()=>{var T;(T=W.current)==null||T.abort(),W.current=new AbortController;const D=++A.current;R(null),fe(!0);try{const P=await Vo();u(P);const we=await Sx();await pu(we,D)}catch(P){R((P==null?void 0:P.message)||"Couldn't fetch system info or configuration.")}finally{fe(!1)}};_.useEffect(()=>{la()},[]),_.useEffect(()=>()=>{var D;le.current&&(clearTimeout(le.current),le.current=null),(D=W.current)==null||D.abort()},[]);const Vl=async D=>{const T=vn();m(D);try{const P=await Nx(D);if(!pt(T))return;d(P);const we=P.extensions.includes(p)?p:P.extensions[0]??"",Oe=P.filters.includes(y)?y:P.filters[0]??"";x(we),g(Oe),await On(T,{directory:D,extension:we,filter_text:Oe,recursive:w})}catch(P){pt(T)&&he(`Directory change failed: ${P.message}`,"error")}finally{gt(T)}},rl=async()=>{if(!f)return;const D=vn();try{await On(D,{directory:f,extension:p,filter_text:y,recursive:w})}catch(T){pt(D)&&he(`Scan failed: ${(T==null?void 0:T.message)??T}`,"error")}finally{gt(D)}},Sl=_.useRef(rl);_.useEffect(()=>{Sl.current=rl});const gu=D=>{g(D),le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{le.current=null,Sl.current()},qy)},Qn=D=>{v(D),le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{le.current=null,Sl.current()},qy)},Lt=async()=>{if(g(""),!f)return;const D=vn();try{await On(D,{directory:f,extension:p,filter_text:"",recursive:w})}catch(T){pt(D)&&he(`Scan failed: ${(T==null?void 0:T.message)??T}`,"error")}finally{gt(D)}},ln=async()=>{if(v(!1),!f)return;const D=vn();try{await On(D,{directory:f,extension:p,filter_text:y,recursive:!1})}catch(T){pt(D)&&he(`Scan failed: ${T.message}`,"error")}finally{gt(D)}},wn=async(D,T)=>{if(D.has_hook){ue({file:D,args:T});return}try{await g2({directory:f,filename:D.rel_path,release:s==null?void 0:s.release,args:T}),he(`Launched ${D.filename}`)}catch(P){he(`Launch error: ${P.message}`,"error")}},ia=()=>{Ke.length>0&&Ke[V]&&wn(Ke[V])},vs=D=>{var T;jt.current=((T=Ke[D])==null?void 0:T.path)??null,se(D)},ws=async(D,T)=>{wn(D,T)},xu=async D=>{try{await Yy(D.path),he("Revealed in file manager.")}catch(T){he(`Error: ${T.message}`,"error")}},ji=async D=>{try{await yd(D.path),he("Folder opened in file manager.")}catch(T){he(`Error: ${T.message}`,"error")}},rr=async D=>{try{const T=await jx(D.path);he(T.message||"Terminal opened.")}catch(T){he(`Error: ${T.message}`,"error")}},ar=async D=>{try{await Vl(D),he(`Scanned directory: ${D}`)}catch(T){he(`Error: ${T.message}`,"error")}},Nl=D=>{g(D);const T=vn();On(T,{directory:f,extension:p,filter_text:D,recursive:w}).catch(P=>{pt(T)&&he(`Scan failed: ${(P==null?void 0:P.message)??P}`,"error")}).finally(()=>gt(T))},Yl=D=>{x(D);const T=vn();On(T,{directory:f,extension:D,filter_text:y,recursive:w}).catch(P=>{pt(T)&&he(`Scan failed: ${(P==null?void 0:P.message)??P}`,"error")}).finally(()=>gt(T))},Ci=async(D,T)=>{const P=T?D.path.replace(/\\/g,"/"):D.path;try{await navigator.clipboard.writeText(P),he("Path copied to clipboard.")}catch(we){he(`Copy failed: ${(we==null?void 0:we.message)??we}`,"error")}},Gl=async(D,T)=>{let P=D.filename;if(T){const we=P.lastIndexOf(".");we!==-1&&(P=P.slice(0,we))}try{await navigator.clipboard.writeText(P),he("Filename copied to clipboard.")}catch(we){he(`Copy failed: ${(we==null?void 0:we.message)??we}`,"error")}},_t=async(D,T)=>{try{he(`Computing ${T.toUpperCase()}...`);const P=await Cx(D.path,T);await navigator.clipboard.writeText(P.hash),he(`${T.toUpperCase()} hash copied: ${P.hash.slice(0,12)}...`)}catch(P){he(`Hash computation failed: ${P.message}`,"error")}},yu=async D=>{try{const T=new URL("file:///").href+D.path.replace(/\\/g,"/");await navigator.clipboard.writeText(T),he("File URI copied to clipboard.")}catch(T){he(`URI copy failed: ${T.message}`,"error")}},bu=async(D,T)=>{try{const P=await navigator.clipboard.readText();if(!P.trim()){he("Clipboard is empty — copy a hash first, then try again.");return}he(`Computing ${T.toUpperCase()}...`);const Oe=(await Cx(D.path,T)).hash.toLowerCase()===P.trim().toLowerCase();he(Oe?`✅ ${T.toUpperCase()} matches!`:`❌ ${T.toUpperCase()} mismatch`)}catch(P){he(`Verification failed: ${P.message}`,"error")}},ra=D=>{bn(D),St(!0)},El=D=>{Je(D)},Ql=async()=>{const D=nt;if(Je(null),!!D)try{if(he("Deleting file..."),!(await fetch("/api/actions/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:D.path})})).ok)throw new Error("Failed to delete file");he("File deleted successfully."),rl()}catch(T){he(`Delete failed: ${T.message}`,"error")}},ks=D=>{zn(D.path),Tt(!0)},aa=async()=>{if(f)try{await yd(f),he("Directory opened in file manager.")}catch(D){he(`Error: ${D.message}`,"error")}},vu=async D=>{if(D)try{await jx(D),he("Terminal opened in directory.")}catch(T){he(`Error: ${T.message}`,"error")}},wu=async()=>{try{await Vl("~"),he("Directory set to home folder.")}catch(D){he(`Error: ${D.message}`,"error")}},Pe=async()=>{if(f)try{const D=await p2(f);D.parent_path?(await Vl(D.parent_path),he("Moved to parent directory.")):he("Already at root directory.")}catch(D){he(`Error: ${D.message}`,"error")}},ku=async()=>{if(S.length===0){he("No files to export.");return}try{const D=H4(S,(s==null?void 0:s.column_names)||[],s??void 0,y),T=`profiles-export-${new Date().toISOString().slice(0,19).replace(/[:.]/g,"-")}.csv`,P=await b2(D,T);he(`Exported ${S.length} loaded row${S.length===1?"":"s"}${y?` matching "${y}"`:""} — ${P.message}`)}catch(D){he(`Export failed: ${D.message}`,"error")}},ur=async D=>{var Re,Qe;Mn(!1),he("Barcode detected!");const P=By(D).values,we=P.dir!==void 0?P.dir:f,Oe=P.ext!==void 0?P.ext:p,Ye=P.filter!==void 0?P.filter:y,qt=P.recursive!==void 0?P.recursive:w;if(P.dir!==void 0&&m(P.dir),P.ext!==void 0&&x(P.ext),P.filter!==void 0&&g(P.filter),P.recursive!==void 0&&v(P.recursive),we){const at=vn();try{await Ex({directory:we,extension:Oe,filter_text:Ye,recursive:qt},(Re=W.current)==null?void 0:Re.signal);const al=await Pf({offset:0,limit:ed,sort_by:B==null?void 0:B.column,sort_dir:B==null?void 0:B.direction,signal:(Qe=W.current)==null?void 0:Qe.signal});if(!pt(at))return;C(al.items),z(al.count),I(!0),jt.current=null,se(0),al.count===1&&al.items.length===1&&Nt(al.items[0])}catch(al){pt(at)&&he(`Scan error: ${al.message}`,"error")}finally{gt(at)}}},or=()=>{Ce(D=>{const T=!D;return T?(ft.current="",he("Barcode mode ON — scan a barcode now.")):(ft.current="",he("Barcode mode OFF.")),T})},Xn=D=>{D.filter!==void 0&&g(D.filter),D.ext!==void 0&&x(D.ext),D.recursive!==void 0&&v(D.recursive),D.dir!==void 0&&m(D.dir),(D.scan===!0||D.filter!==void 0||D.ext!==void 0||D.recursive!==void 0||D.dir!==void 0)&&(Ce(!1),ft.current="",setTimeout(()=>{Sl.current()},50))};_.useEffect(()=>{if(!ke)return;const D=T=>{const P=T.target;if(!(P instanceof HTMLElement&&(P.isContentEditable||P instanceof HTMLInputElement||P instanceof HTMLTextAreaElement||P instanceof HTMLSelectElement)))if(T.key==="Enter"){const Oe=ft.current;if(!Oe){ft.current="";return}T.preventDefault(),ft.current="";const Ye=By(Oe);if(Ye.isPlainFilter)he(`Barcode filter: ${Ye.values.filter}`),g(Ye.values.filter||""),Ce(!1),setTimeout(()=>void Sl.current(),50);else{const qt=Ye.values,Re=Object.entries(qt).map(([Qe,at])=>`${Qe}=${at}`).join(", ");he(`Barcode applied: ${Re}`),Xn(qt)}}else T.key==="Escape"?(Ce(!1),ft.current="",he("Barcode mode cancelled.")):T.key.length===1&&!T.ctrlKey&&!T.metaKey&&!T.altKey&&(ft.current+=T.key)};return document.addEventListener("keydown",D,!0),()=>document.removeEventListener("keydown",D,!0)},[ke]),_.useEffect(()=>(Et>0&&(Qt.current=setInterval(()=>{Sl.current()},Et*1e3)),()=>{Qt.current&&(clearInterval(Qt.current),Qt.current=null)}),[Et]);const un=D=>{Gn(D),D>0?he(`Auto-rescan every ${D}s.`):he("Auto-rescan disabled.")},ua=!!(qe||M||pe||Rt||Gt||tn||ge||it||Dn||ll||K||nt);return _.useEffect(()=>{const D=T=>{var we,Oe,Ye,qt;if(T.key==="Escape"){Ge(null),E(!1),Ht(!1),Me(!1),Ni(Wo());return}if(ua)return;if(T.ctrlKey&&!T.shiftKey&&T.key.toLowerCase()==="l"){T.preventDefault(),(we=document.querySelector("[data-testid='file-list']"))==null||we.focus();return}const P=T.target;if(!(P instanceof HTMLElement&&P.closest("button, a, [role='menuitem'], [role='option'], [role='columnheader'], [role='separator']"))){if(P instanceof HTMLInputElement||P instanceof HTMLSelectElement){T.key==="Enter"&&rl();return}if(T.key==="ContextMenu"||T.shiftKey&&T.key==="F10"){const Re=Ke[V];if(!Re)return;T.preventDefault();const Qe=document.querySelector(`[data-row-index="${V}"]`),at=Qe==null?void 0:Qe.getBoundingClientRect();Ge({x:at?at.left+24:24,y:at?at.top+at.height/2:24,file:Re});return}if(T.key==="F5"){T.preventDefault(),rl();return}if(T.ctrlKey&&T.key.toLowerCase()==="r"){T.preventDefault(),Si();return}if(T.ctrlKey&&T.key.toLowerCase()==="d"){T.preventDefault(),(Oe=document.querySelector("#directory-combobox"))==null||Oe.focus();return}if(T.ctrlKey&&T.key.toLowerCase()==="e"){T.preventDefault(),(Ye=document.querySelector("#extension-combobox"))==null||Ye.focus();return}if(T.ctrlKey&&T.key.toLowerCase()==="f"){T.preventDefault(),(qt=document.querySelector("#filter-combobox"))==null||qt.focus();return}if(T.ctrlKey&&T.shiftKey&&T.key.toLowerCase()==="l"){T.preventDefault(),Ht(Re=>!Re);return}if(T.ctrlKey&&T.key===","){T.preventDefault(),Tx().then(Re=>he(Re.message));return}if(T.ctrlKey&&T.shiftKey&&T.key.toLowerCase()==="t"){T.preventDefault(),r(Re=>Re==="dark"?"light":"dark");return}if(T.ctrlKey&&!T.shiftKey&&T.key.toLowerCase()==="b"){T.preventDefault(),Ce(Re=>!Re);return}if(T.ctrlKey&&T.shiftKey&&T.key.toLowerCase()==="b"){T.preventDefault(),Mn(Re=>!Re);return}if(T.ctrlKey&&!T.shiftKey&&T.key.toLowerCase()==="t"){T.preventDefault(),Me(!0);return}if(T.ctrlKey&&!T.shiftKey&&T.key.toLowerCase()==="h"){T.preventDefault(),wu();return}if(T.key==="?"||T.ctrlKey&&T.key==="/"){T.preventDefault(),E(Re=>!Re);return}if(T.key.toLowerCase()==="p"&&!T.ctrlKey&&!T.shiftKey&&!T.altKey){const Re=Ke[V];Re&&(T.preventDefault(),ra(Re));return}T.key==="ArrowDown"?(T.preventDefault(),se(Re=>{var at;const Qe=Math.min(Re+1,Math.max(0,Ke.length-1));return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Qe})):T.key==="ArrowUp"?(T.preventDefault(),se(Re=>{var at;const Qe=Math.max(Re-1,0);return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Qe})):T.key==="Home"?(T.preventDefault(),se(Re=>{var Qe;return jt.current=((Qe=Ke[0])==null?void 0:Qe.path)??null,Re===0?Re:0})):T.key==="End"?(T.preventDefault(),se(Re=>{var at;const Qe=Math.max(0,Ke.length-1);return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Re===Qe?Re:Qe})):T.key==="PageUp"?(T.preventDefault(),se(Re=>{var at;const Qe=Math.max(Re-Fy,0);return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Qe})):T.key==="PageDown"?(T.preventDefault(),se(Re=>{var at;const Qe=Math.min(Re+Fy,Math.max(0,Ke.length-1));return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Qe})):T.key==="Enter"&&(T.preventDefault(),ia())}};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[ua,Ke,V,f,p,y,w,ke]),_.useEffect(()=>{document.documentElement.setAttribute("data-theme",n);try{localStorage.setItem("profiles-theme",n)}catch{}},[n]),h.jsxs("div",{className:"flex h-dvh flex-col bg-elevated/30 p-1 font-sans text-ink transition-colors duration-200 sm:p-1.5",children:[h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-frame-line bg-app shadow-[0_2px_6px_rgb(0_0_0/0.35)] transition-colors duration-200 sm:rounded-xl",children:[h.jsx(gk,{title:(s==null?void 0:s.title)||"",release:(s==null?void 0:s.release)||"",directories:(s==null?void 0:s.directories)||[],activeDirectory:f,onDirectoryChange:Vl,onBrowseDirectory:bs,onGoToParentDirectory:Pe,onGoToHomeDirectory:wu,onOpenActiveDirectory:aa,onOpenTerminal:vu}),h.jsx(Ek,{extensions:(s==null?void 0:s.extensions)||[],activeExtension:p,onExtensionChange:x,filterOptions:(s==null?void 0:s.filters)||[],filterText:y,onFilterTextChange:gu,recursive:w,onRecursiveChange:Qn,onScan:rl,scanning:ve,barcodeMode:ke,onBarcodeToggle:or,onCameraBarcodeClick:()=>Mn(!0),autoRescanActive:Et>0,onTimerClick:()=>Me(!0)}),U?h.jsx(xk,{message:U,onRetry:()=>void la(),retrying:Q}):h.jsx(pk,{files:Ke,totalCount:L,rawLoadedCount:S.length,onLoadMore:lr,loadingMore:J,scanning:ve,hasScanned:$,activeDirectory:f,recursive:w,onDisableRecursive:ln,onOpenDirectory:aa,onOpenConfig:()=>Bt(!0),filterText:y,onClearFilter:Lt,columnHeaders:(s==null?void 0:s.column_headers)||[],columnNames:(s==null?void 0:s.column_names)||[],selectedIndex:V,onSelectIndex:vs,prefilterNote:ys,onLaunch:wn,onContextMenu:(D,T,P)=>{D.preventDefault(),jt.current=T.path,se(P),Ge({x:D.clientX,y:D.clientY,file:T})},rowColors:(s==null?void 0:s.row_colors)||[],sort:B,onSortChange:D=>{ne(D),jt.current=null,se(0);const T=vn();du(T,D).catch(P=>{pt(T)&&he(`Sort failed: ${P.message}`,"error")}).finally(()=>gt(T))}}),h.jsx(rk,{onExecute:ia,scanning:ve,scanningDirectory:f,hasSelection:Ke.length>0,fileCount:Ke.length,totalCount:L,toastMessage:Y,onToastDismiss:fu}),h.jsx(Xk,{systemInfo:a,fileCount:L,theme:n,onToggleTheme:()=>r(D=>D==="dark"?"light":"dark"),onOpenLog:()=>Ht(!0),onOpenConfig:async()=>{try{const D=await Tx();he(D.message)}catch(D){he(`Failed to open config: ${D.message}`,"error")}},onLoadConfig:()=>Bt(!0),onShowShortcuts:()=>E(!0),onReloadConfig:Si,onExport:ku,exportDisabled:S.length===0||ve,language:ye,onLanguageChange:_e,activeConfigName:s!=null&&s.config_path?s.config_path.split(/[\\/]/).pop()||s.config_path:void 0,lanEnabled:(a==null?void 0:a.lan_enabled)??null,onToggleLan:xs})]}),h.jsx(zk,{isOpen:Rt,activeConfigPath:s==null?void 0:s.config_path,configExists:s==null?void 0:s.config_exists,onClose:()=>Bt(!1),onLoaded:ql}),h.jsx(hk,{visible:wl,onFileSelected:D=>na.current(D)}),h.jsx(dk,{isOpen:pe,initialPath:f,onClose:()=>Se(!1),onSelect:mu}),h.jsx(ak,{position:qe,onClose:()=>Ge(null),onLaunch:wn,onLaunchWithArgs:ws,onReveal:xu,onOpenFolder:ji,onOpenTerminal:rr,onScanDirectory:ar,onFilterFolder:Nl,onFilterExtension:Yl,onCopyPath:Ci,onCopyFilename:Gl,onCopyUri:yu,onComputeHash:_t,onVerifyHash:bu,onProperties:ra,onClearFile:El,onGenerateBarcode:ks,showToast:he}),h.jsx(Ak,{isOpen:M,onClose:()=>E(!1)}),h.jsx(Lk,{isOpen:Gt,file:en,onLaunch:wn,onClose:()=>{St(!1),bn(null)}}),h.jsx(Kk,{isOpen:ge,currentInterval:Et,onClose:()=>Me(!1),onSetInterval:un}),h.jsx(_k,{isOpen:tn,onClose:()=>Ht(!1),onOpenExternally:()=>{u2().then(D=>he(D.message))}}),h.jsx(L4,{isOpen:!!K,onClose:()=>ue(null),directory:f,filename:(K==null?void 0:K.file.rel_path)||"",release:s==null?void 0:s.release,args:K==null?void 0:K.args,onFinished:(D,T)=>{D==="completed"?he(T||"Workflow launched successfully."):(D==="aborted"||D==="failed")&&he(`Workflow stopped: ${T}`,"error")}}),h.jsx(nb,{isOpen:it,onClose:()=>{Tt(!1),zn(void 0)},initialFilePath:nn}),h.jsx(Gk,{isOpen:Dn,onClose:()=>Mn(!1),onDetected:ur}),h.jsx(Ly,{isOpen:!!nt,title:"Delete file",message:`Delete this file? +`,...d.current()});const y=x.charCodeAt(0);return(y===9||y===32)&&(x=Xb(y)+x.slice(1)),x=x?f+" "+x:f,a.options.closeAtx&&(x+=" "+f),p(),m(),x}Zb.peek=S5;function Zb(n){return n.value||""}function S5(){return"<"}$b.peek=N5;function $b(n,r,a,u){const s=uh(a),d=s==='"'?"Quote":"Apostrophe",f=a.enter("image");let m=a.enter("label");const p=a.createTracker(u);let x=p.move("![");return x+=p.move(a.safe(n.alt,{before:x,after:"]",...p.current()})),x+=p.move("]("),m(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(m=a.enter("destinationLiteral"),x+=p.move("<"),x+=p.move(a.safe(n.url,{before:x,after:">",...p.current()})),x+=p.move(">")):(m=a.enter("destinationRaw"),x+=p.move(a.safe(n.url,{before:x,after:n.title?" ":")",...p.current()}))),m(),n.title&&(m=a.enter(`title${d}`),x+=p.move(" "+s),x+=p.move(a.safe(n.title,{before:x,after:s,...p.current()})),x+=p.move(s),m()),x+=p.move(")"),f(),x}function N5(){return"!"}Jb.peek=E5;function Jb(n,r,a,u){const s=n.referenceType,d=a.enter("imageReference");let f=a.enter("label");const m=a.createTracker(u);let p=m.move("![");const x=a.safe(n.alt,{before:p,after:"]",...m.current()});p+=m.move(x+"]["),f();const y=a.stack;a.stack=y.filter(function(w){return w!=="phrasing"}),f=a.enter("reference");const g=a.safe(a.associationId(n),{before:p,after:"]",...m.current()});return f(),a.stack=y,d(),s==="full"||!x||x!==g?p+=m.move(g+"]"):s==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function E5(){return"!"}Pb.peek=j5;function Pb(n,r,a){let u=n.value||"",s="`",d=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(u);)s+="`";for(/[^\n\r ]/.test(u)&&(/^[\n\r ]/.test(u)&&/[\n\r ]$/.test(u)||/^`|`$/.test(u))&&(u=" "+u+" ");++d\u007F]/.test(n.url))}e0.peek=C5;function e0(n,r,a,u){const s=uh(a),d=s==='"'?"Quote":"Apostrophe",f=a.createTracker(u);if(Wb(n,a)){const S=a.stack;a.stack=S.filter(function(D){return D!=="phrasing"});const T=a.enter("autolink");let L=f.move("<");return L+=f.move(a.containerPhrasing(n,{before:L,after:">",...f.current()})),L+=f.move(">"),T(),a.stack=S,L}const m=a.enter("link");let p=a.enter("label"),x=f.move("[");const y=a.containerPhrasing(n,{before:x,after:"](",...f.current()});x+=f.move(y),p(),x+=f.move("](");const g=/[\0- \u007F]/.test(n.url),w=u.before.charAt(u.before.length-1);let v=n.title||void 0;if(!v&&!g&&(w===` +`||w==="\r")){let S=0;for(;S",...f.current()})),x+=f.move(">")):(p=a.enter("destinationRaw"),x+=f.move(a.safe(n.url,{before:x,after:typeof v=="string"?" ":")",...f.current()}))),p(),typeof v=="string"&&(p=a.enter(`title${d}`),x+=f.move(" "+s),x+=f.move(a.safe(v,{before:x,after:s,...f.current()})),x+=f.move(s),p()),x+=f.move(")"),m(),x}function C5(n,r,a){return Wb(n,a)?"<":"["}t0.peek=T5;function t0(n,r,a,u){const s=n.referenceType,d=a.enter("linkReference");let f=a.enter("label");const m=a.createTracker(u);let p=m.move("[");const x=a.containerPhrasing(n,{before:p,after:"]",...m.current()});p+=m.move(x+"]["),f();const y=a.stack;a.stack=y.filter(function(w){return w!=="phrasing"}),f=a.enter("reference");const g=a.safe(a.associationId(n),{before:p,after:"]",...m.current()});return f(),a.stack=y,d(),s==="full"||!x||x!==g?p+=m.move(g+"]"):s==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function T5(){return"["}function fh(n){const r=n.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function _5(n){const r=fh(n),a=n.options.bulletOther;if(!a)return r==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+a+"`) to be different");return a}function A5(n){const r=n.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function n0(n){const r=n.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function z5(n,r,a,u){const s=a.enter("list"),d=a.bulletCurrent;let f=n.ordered?A5(a):fh(a);const m=n.ordered?f==="."?")":".":_5(a);let p=r&&a.bulletLastUsed?f===a.bulletLastUsed:!1;if(!n.ordered){const y=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&y&&(!y.children||!y.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(p=!0),n0(a)===f&&y){let g=-1;for(;++g-1?r.start:1)+(a.options.incrementListMarker===!1?0:r.children.indexOf(n))+d);let f=d.length+1;(s==="tab"||s==="mixed"&&(r&&r.type==="list"&&r.spread||n.spread))&&(f=Math.ceil(f/4)*4);const m=a.createTracker(u);m.move(d+" ".repeat(f-d.length)),m.shift(f);const p=a.enter("listItem"),x=a.indentLines(a.containerFlow(n,m.current()),y);return p(),x;function y(g,w,v){return w?(v?"":" ".repeat(f))+g:(v?d:d+" ".repeat(f-d.length))+g}}function O5(n,r,a,u){const s=a.enter("paragraph"),d=a.enter("phrasing"),f=a.containerPhrasing(n,u);return d(),s(),f}function R5(n,r,a,u){if(!n.children.some(function(m){return n5(m)}))return a.containerFlow(n,u);const d=a.enter("phrasing"),f=a.containerPhrasing(n,u);return d(),f}function L5(n){const r=n.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}dh.attention=l0;dh.peek=U5;function dh(n,r,a,u){const s=a.enter("phrasing"),d=oh(n,l0,a,a.createTracker(u)),f=gs([d],u.before,u.after);return s(),f}function l0(n,r){return{construct:"strong",markers:L5(r)==="*"?["*","_"]:["_","*"],sizes:[2]}}function U5(n,r,a){return a.options.strong||"*"}function B5(n,r,a,u){const s=r?r.children:[],d=a.indexStack[a.indexStack.length-1];return a.safe(n.value,{...u,afterNode:s[d+1],beforeNode:s[d-1]})}function H5(n){const r=n.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function q5(n,r,a){const u=(n0(a)+(a.options.ruleSpaces?" ":"")).repeat(H5(a));return a.options.ruleSpaces?u.slice(0,-1):u}const i0={blockquote:l5,break:Ay,code:s5,definition:f5,emphasis:ch,hardBreak:Ay,heading:k5,html:Zb,image:$b,imageReference:Jb,inlineCode:Pb,link:e0,linkReference:t0,list:z5,listItem:M5,paragraph:O5,root:R5,strong:dh,text:B5,thematicBreak:q5};function F5(){return{enter:{table:V5,tableData:Dy,tableHeader:Dy,tableRow:G5},exit:{codeText:Q5,table:Y5,tableData:xd,tableHeader:xd,tableRow:xd}}}function V5(n){const r=n._align;this.enter({type:"table",align:r.map(function(a){return a==="none"?null:a}),children:[]},n),this.data.inTable=!0}function Y5(n){this.exit(n),this.data.inTable=void 0}function G5(n){this.enter({type:"tableRow",children:[]},n)}function xd(n){this.exit(n)}function Dy(n){this.enter({type:"tableCell",children:[]},n)}function Q5(n){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,X5));const a=this.stack[this.stack.length-1];a.type,a.value=r,this.exit(n)}function X5(n,r){return r==="|"?r:n}function I5(n){const r=n||{},a=r.tableCellPadding,u=r.tablePipeAlign,s=r.stringLength,d=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:w,table:f,tableCell:p,tableRow:m}};function f(v,S,T,L){return x(y(v,T,L),v.align)}function m(v,S,T,L){const D=g(v,T,L),$=x([D]);return $.slice(0,$.indexOf(` +`))}function p(v,S,T,L){const D=T.enter("tableCell"),$=T.enter("phrasing"),I=T.containerPhrasing(v,{...L,before:d,after:d});return $(),D(),I}function x(v,S){return e5(v,{align:S,alignDelimiters:u,padding:a,stringLength:s})}function y(v,S,T){const L=v.children;let D=-1;const $=[],I=S.enter("table");for(;++D0&&!a&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const f4={tokenize:b4,partial:!0};function d4(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:g4,continuation:{tokenize:x4},exit:y4}},text:{91:{name:"gfmFootnoteCall",tokenize:p4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:h4,resolveTo:m4}}}}function h4(n,r,a){const u=this;let s=u.events.length;const d=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let f;for(;s--;){const p=u.events[s][1];if(p.type==="labelImage"){f=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return m;function m(p){if(!f||!f._balanced)return a(p);const x=tl(u.sliceSerialize({start:f.end,end:u.now()}));return x.codePointAt(0)!==94||!d.includes(x.slice(1))?a(p):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(p),n.exit("gfmFootnoteCallLabelMarker"),r(p))}}function m4(n,r){let a=n.length;for(;a--;)if(n[a][1].type==="labelImage"&&n[a][0]==="enter"){n[a][1];break}n[a+1][1].type="data",n[a+3][1].type="gfmFootnoteCallLabelMarker";const u={type:"gfmFootnoteCall",start:Object.assign({},n[a+3][1].start),end:Object.assign({},n[n.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},n[a+3][1].end),end:Object.assign({},n[a+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const d={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},d.start),end:Object.assign({},d.end)},m=[n[a+1],n[a+2],["enter",u,r],n[a+3],n[a+4],["enter",s,r],["exit",s,r],["enter",d,r],["enter",f,r],["exit",f,r],["exit",d,r],n[n.length-2],n[n.length-1],["exit",u,r]];return n.splice(a,n.length-a+1,...m),n}function p4(n,r,a){const u=this,s=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let d=0,f;return m;function m(g){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),p}function p(g){return g!==94?a(g):(n.enter("gfmFootnoteCallMarker"),n.consume(g),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",x)}function x(g){if(d>999||g===93&&!f||g===null||g===91||mt(g))return a(g);if(g===93){n.exit("chunkString");const w=n.exit("gfmFootnoteCallString");return s.includes(tl(u.sliceSerialize(w)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),r):a(g)}return mt(g)||(f=!0),d++,n.consume(g),g===92?y:x}function y(g){return g===91||g===92||g===93?(n.consume(g),d++,x):x(g)}}function g4(n,r,a){const u=this,s=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let d,f=0,m;return p;function p(S){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(S),n.exit("gfmFootnoteDefinitionLabelMarker"),x}function x(S){return S===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(S),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",y):a(S)}function y(S){if(f>999||S===93&&!m||S===null||S===91||mt(S))return a(S);if(S===93){n.exit("chunkString");const T=n.exit("gfmFootnoteDefinitionLabelString");return d=tl(u.sliceSerialize(T)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(S),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),w}return mt(S)||(m=!0),f++,n.consume(S),S===92?g:y}function g(S){return S===91||S===92||S===93?(n.consume(S),f++,y):y(S)}function w(S){return S===58?(n.enter("definitionMarker"),n.consume(S),n.exit("definitionMarker"),s.includes(d)||s.push(d),et(n,v,"gfmFootnoteDefinitionWhitespace")):a(S)}function v(S){return r(S)}}function x4(n,r,a){return n.check(su,r,n.attempt(f4,r,a))}function y4(n){n.exit("gfmFootnoteDefinition")}function b4(n,r,a){const u=this;return et(n,s,"gfmFootnoteDefinitionIndent",5);function s(d){const f=u.events[u.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(d):a(d)}}function v4(n){let a=(n||{}).singleTilde;const u={name:"strikethrough",tokenize:d,resolveAll:s};return a==null&&(a=!0),{text:{126:u},insideSpan:{null:[u]},attentionMarkers:{null:[126]}};function s(f,m){let p=-1;for(;++p1?p(S):(f.consume(S),g++,v);if(g<2&&!a)return p(S);const L=f.exit("strikethroughSequenceTemporary"),D=wi(S);return L._open=!D||D===2&&!!T,L._close=!T||T===2&&!!D,m(S)}}}class w4{constructor(){this.map=[],this.index=new Map}add(r,a,u){k4(this,r,a,u)}consume(r){if(this.map.sort(function(d,f){return d[0]-f[0]}),this.map.length===0)return;let a=this.map.length;const u=[];for(;a>0;)a-=1,u.push(r.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),r.length=this.map[a][0];u.push(r.slice()),r.length=0;let s=u.pop();for(;s;){for(const d of s)r.push(d);s=u.pop()}this.map.length=0,this.index.clear()}}function k4(n,r,a,u){if(a===0&&u.length===0)return;const s=n.index.get(r);if(s){s[1]+=a,s[2].push(...u);return}const d=[r,a,u];n.map.push(d),n.index.set(r,d)}function S4(n,r){let a=!1;const u=[];for(;r-1;){const{type:ve}=u.events[ne][1];if(ve==="lineEnding"||ve==="linePrefix")ne--;else break}const V=ne>-1?u.events[ne][1].type:null,se=V==="tableHead"||V==="tableRow"?U:p;return se===U&&u.parser.lazy[u.now().line]?a(B):se(B)}function p(B){return n.enter("tableHead"),n.enter("tableRow"),x(B)}function x(B){return B===124||(f=!0,d+=1),y(B)}function y(B){return B===null?a(B):Te(B)?d>1?(d=0,u.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(B),n.exit("lineEnding"),v):a(B):Ve(B)?et(n,y,"whitespace")(B):(d+=1,f&&(f=!1,s+=1),B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),f=!0,y):(n.enter("data"),g(B)))}function g(B){return B===null||B===124||mt(B)?(n.exit("data"),y(B)):(n.consume(B),B===92?w:g)}function w(B){return B===92||B===124?(n.consume(B),g):g(B)}function v(B){return u.interrupt=!1,u.parser.lazy[u.now().line]?a(B):(n.enter("tableDelimiterRow"),f=!1,Ve(B)?et(n,S,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):S(B))}function S(B){return B===45||B===58?L(B):B===124?(f=!0,n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),T):ie(B)}function T(B){return Ve(B)?et(n,L,"whitespace")(B):L(B)}function L(B){return B===58?(d+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),D):B===45?(d+=1,D(B)):B===null||Te(B)?J(B):ie(B)}function D(B){return B===45?(n.enter("tableDelimiterFiller"),$(B)):ie(B)}function $(B){return B===45?(n.consume(B),$):B===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),I):(n.exit("tableDelimiterFiller"),I(B))}function I(B){return Ve(B)?et(n,J,"whitespace")(B):J(B)}function J(B){return B===124?S(B):B===null||Te(B)?!f||s!==d?ie(B):(n.exit("tableDelimiterRow"),n.exit("tableHead"),r(B)):ie(B)}function ie(B){return a(B)}function U(B){return n.enter("tableRow"),R(B)}function R(B){return B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),R):B===null||Te(B)?(n.exit("tableRow"),r(B)):Ve(B)?et(n,R,"whitespace")(B):(n.enter("data"),Q(B))}function Q(B){return B===null||B===124||mt(B)?(n.exit("data"),R(B)):(n.consume(B),B===92?fe:Q)}function fe(B){return B===92||B===124?(n.consume(B),Q):Q(B)}}function j4(n,r){let a=-1,u=!0,s=0,d=[0,0,0,0],f=[0,0,0,0],m=!1,p=0,x,y,g;const w=new w4;for(;++aa[2]+1){const S=a[2]+1,T=a[3]-a[2]-1;n.add(S,T,[])}}n.add(a[3]+1,0,[["exit",g,r]])}return s!==void 0&&(d.end=Object.assign({},Ir(r.events,s)),n.add(s,0,[["exit",d,r]]),d=void 0),d}function Oy(n,r,a,u,s){const d=[],f=Ir(r.events,a);s&&(s.end=Object.assign({},f),d.push(["exit",s,r])),u.end=Object.assign({},f),d.push(["exit",u,r]),n.add(a+1,0,d)}function Ir(n,r){const a=n[r],u=a[0]==="enter"?"start":"end";return a[1][u]}const C4={name:"tasklistCheck",tokenize:_4};function T4(){return{text:{91:C4}}}function _4(n,r,a){const u=this;return s;function s(p){return u.previous!==null||!u._gfmTasklistFirstContentOfListItem?a(p):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(p),n.exit("taskListCheckMarker"),d)}function d(p){return mt(p)?(n.enter("taskListCheckValueUnchecked"),n.consume(p),n.exit("taskListCheckValueUnchecked"),f):p===88||p===120?(n.enter("taskListCheckValueChecked"),n.consume(p),n.exit("taskListCheckValueChecked"),f):a(p)}function f(p){return p===93?(n.enter("taskListCheckMarker"),n.consume(p),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),m):a(p)}function m(p){return Te(p)?r(p):Ve(p)?n.check({tokenize:A4},r,a)(p):a(p)}}function A4(n,r,a){return et(n,u,"whitespace");function u(s){return s===null?a(s):r(s)}}function z4(n){return yb([n4(),d4(),v4(n),N4(),T4()])}const D4={};function M4(n){const r=this,a=n||D4,u=r.data(),s=u.micromarkExtensions||(u.micromarkExtensions=[]),d=u.fromMarkdownExtensions||(u.fromMarkdownExtensions=[]),f=u.toMarkdownExtensions||(u.toMarkdownExtensions=[]);s.push(z4(a)),d.push(P5()),f.push(W5(a))}function O4(n){return n.replace(/\\n/g,` +`).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\'/g,"'").replace(/\\\\/g,"\\")}const R4={h1:({children:n})=>h.jsx("h3",{className:"mt-3 mb-1.5 text-base font-bold text-ink first:mt-0",children:n}),h2:({children:n})=>h.jsx("h4",{className:"mt-3 mb-1 text-sm font-semibold text-ink first:mt-0",children:n}),h3:({children:n})=>h.jsx("h5",{className:"mt-2 mb-1 text-xs font-semibold text-ink first:mt-0",children:n}),p:({children:n})=>h.jsx("p",{className:"my-1.5 leading-relaxed first:mt-0 last:mb-0",children:n}),strong:({children:n})=>h.jsx("strong",{className:"font-semibold text-ink",children:n}),em:({children:n})=>h.jsx("em",{className:"italic text-ink-secondary",children:n}),del:({children:n})=>h.jsx("del",{className:"text-ink-muted line-through",children:n}),a:({children:n,href:r})=>h.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-chip-indigo-text underline underline-offset-2 hover:text-ink",children:n}),code:({children:n,className:r})=>h.jsx("code",{className:`break-words rounded bg-elevated px-1 py-0.5 font-mono text-chip-indigo-text whitespace-pre-wrap ${r??""}`,children:n}),pre:({children:n})=>h.jsx("pre",{className:"my-2 overflow-x-auto rounded-lg border border-line bg-elevated p-3 font-mono text-xs text-ink [&_code]:bg-transparent [&_code]:px-0 [&_code]:py-0 [&_code]:text-inherit",children:n}),ul:({children:n})=>h.jsx("ul",{className:"my-1.5 list-disc space-y-0.5 pl-5",children:n}),ol:({children:n})=>h.jsx("ol",{className:"my-1.5 list-decimal space-y-0.5 pl-5",children:n}),li:({children:n})=>h.jsx("li",{className:"leading-relaxed",children:n}),blockquote:({children:n})=>h.jsx("blockquote",{className:"my-2 border-l-2 border-line-strong pl-3 text-ink-secondary italic",children:n}),table:({children:n})=>h.jsx("div",{className:"my-2 overflow-x-auto",children:h.jsx("table",{className:"w-full border-collapse text-xs",children:n})}),th:({children:n})=>h.jsx("th",{className:"border border-line bg-elevated px-2 py-1 text-left font-semibold",children:n}),td:({children:n})=>h.jsx("td",{className:"border border-line px-2 py-1 align-top",children:n}),hr:()=>h.jsx("hr",{className:"my-3 border-line"}),img:({alt:n,src:r,title:a})=>h.jsx("img",{src:r,alt:n,title:a,loading:"lazy",referrerPolicy:"no-referrer",className:"my-2 max-w-full rounded-lg border border-line"})};function $o({text:n}){return n?h.jsx(cj,{remarkPlugins:[M4,wj],components:R4,children:O4(n)}):null}function h0(n){return n==="completed"||n==="aborted"||n==="failed"}function tu({label:n}){return h.jsx("kbd",{"aria-hidden":"true",className:"ml-1.5 inline-block rounded border border-line/60 bg-elevated/60 px-1 py-px font-mono text-[10px] font-normal leading-none opacity-90",children:n})}function Ry(n){!n||h0(n.status)||N2(n.session_id).catch(()=>{})}const L4={running:"running",completed:"done",skipped:"skipped",failed:"failed",pending:"pending"};function Jo({text:n}){const[r,a]=_.useState(!1),u=_.useRef(void 0);_.useEffect(()=>()=>window.clearTimeout(u.current),[]);const s=async()=>{try{await navigator.clipboard.writeText(n),a(!0),window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!1),1500)}catch{}};return h.jsx("button",{type:"button",onClick:s,"aria-label":r?"Copied":"Copy content",title:r?"Copied!":"Copy content",className:"absolute right-2 top-2 rounded-md p-1.5 text-ink-muted hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:r?h.jsx(vi,{className:"h-3.5 w-3.5"}):h.jsx(An,{className:"h-3.5 w-3.5"})})}function U4({isOpen:n,onClose:r,directory:a,filename:u,release:s,args:d,onFinished:f}){var Ge,M;const[m,p]=_.useState(null),[x,y]=_.useState(!1),[g,w]=_.useState(null),[v,S]=_.useState(null),[T,L]=_.useState(!1),[D,$]=_.useState(0),I=_.useRef(null),J=_.useRef(!1),ie=_.useRef(null),U=_.useRef(!1);_.useEffect(()=>{if(!n||!a||!u){p(null),w(null),L(!1),S(null),U.current=!1;return}let E=!0;return y(!0),w(null),L(!1),S(null),k2({directory:a,filename:u,release:s,args:d}).then(Y=>{E&&(p(Y),y(!1),(Y.status==="completed"||Y.status==="aborted"||Y.status==="failed")&&(f==null||f(Y.status,Y.final_message||"")))}).catch(Y=>{E&&((Y==null?void 0:Y.status)===404&&L(!0),w(Y.message||"Failed to start workflow"),y(!1))}),()=>{E=!1}},[n,a,u,s,d,D]);const R=async E=>{if(!(!m||J.current)){J.current=!0,y(!0);try{const Y=await S2(m.session_id,E);p(Y),(Y.status==="completed"||Y.status==="aborted"||Y.status==="failed")&&(f==null||f(Y.status,Y.final_message||""))}catch(Y){(Y==null?void 0:Y.status)===404?(L(!0),w(Y.message||"Workflow session on the server has expired.")):w(Y.message||"Failed to process workflow response")}finally{J.current=!1,y(!1)}}},Q=_.useRef(m);Q.current=m;const fe=_.useRef(R);fe.current=R;const B=_.useRef(v);B.current=v;const ne=_.useRef([]),V=(E,Y)=>{var je,ye;if(E.key!=="ArrowDown"&&E.key!=="ArrowUp"&&E.key!=="Home"&&E.key!=="End")return;E.preventDefault();const oe=((je=Q.current)==null?void 0:je.steps.length)??0;if(oe===0)return;const de=E.key==="ArrowDown"?(Y+1)%oe:E.key==="ArrowUp"?(Y-1+oe)%oe:E.key==="Home"?0:oe-1;S(de),(ye=ne.current[de])==null||ye.focus()};_.useEffect(()=>()=>Ry(Q.current),[]);const se=()=>{U.current||(U.current=!0,Ry(Q.current),r())},ve=()=>{p(null),w(null),L(!1),S(null),U.current=!1,$(E=>E+1)},ae=Wr({isOpen:n,onClose:se,dialogRef:I,initialFocusRef:ie});if(_.useEffect(()=>{if(!n)return;const E=Y=>{var Se,Rt,Bt;if(Y.key==="Escape"){Y.preventDefault(),se();return}const oe=Q.current;if(!oe)return;if(h0(oe.status)){Y.key==="Enter"&&!Y.repeat&&!Y.ctrlKey&&!Y.metaKey&&!Y.altKey&&!J.current&&((Se=Y.target)==null?void 0:Se.tagName)!=="BUTTON"&&((Rt=document.activeElement)==null?void 0:Rt.tagName)!=="BUTTON"&&(Y.preventDefault(),se());return}if(J.current||Y.repeat||Y.ctrlKey||Y.metaKey||Y.altKey)return;const de=Y.target;if((de==null?void 0:de.tagName)==="INPUT"||(de==null?void 0:de.tagName)==="TEXTAREA"||de!=null&&de.isContentEditable)return;const je=B.current,ye=je===null||je===oe.current_index,_e=oe.status==="waiting_ask"?"yes":oe.status==="waiting_notify"||oe.status==="waiting_notice"?"ack":null;if(!ye||_e===null)return;if(Y.key==="Enter"){const Gt=Y.target;if((Gt==null?void 0:Gt.tagName)==="BUTTON"||((Bt=document.activeElement)==null?void 0:Bt.tagName)==="BUTTON")return;Y.preventDefault(),fe.current(_e);return}if(oe.status!=="waiting_ask")return;const pe=Y.key.toLowerCase();pe==="y"?(Y.preventDefault(),fe.current("yes")):pe==="s"?(Y.preventDefault(),fe.current("skip")):pe==="n"&&(Y.preventDefault(),fe.current("no"))};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[n,r]),_.useEffect(()=>{if(!n||!m)return;const E=requestAnimationFrame(()=>{var Y;return(Y=ie.current)==null?void 0:Y.focus()});return()=>cancelAnimationFrame(E)},[n,m==null?void 0:m.status]),!n)return null;const A=v!==null?m==null?void 0:m.steps[v]:m==null?void 0:m.steps[m.current_index],W=(m==null?void 0:m.status)==="completed"||(m==null?void 0:m.status)==="aborted"||(m==null?void 0:m.status)==="failed",le=!!m&&!W&&!T&&(((Ge=m.status)==null?void 0:Ge.startsWith("waiting"))??!1),re=(((M=m==null?void 0:m.steps[(m==null?void 0:m.current_index)??-1])==null?void 0:M.phase)??"pre")==="post",qe=!T&&(v===null||v===(m==null?void 0:m.current_index))&&(A!=null&&A.command)&&((m==null?void 0:m.status)==="waiting_notify"||(m==null?void 0:m.status)==="waiting_notice"||(m==null?void 0:m.status)==="waiting_ask")?h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Command:"}),h.jsxs("div",{className:"relative rounded-lg border border-line bg-surface-strong p-4 pr-10 font-mono text-xs text-ink leading-relaxed",children:[h.jsx(Jo,{text:A.command}),A.command]})]}):null;return h.jsx("div",{ref:I,role:"dialog","aria-modal":"true","aria-labelledby":"workflow-runner-title",onKeyDown:ae,className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-xs",children:h.jsxs("div",{className:"animate-modal-in flex h-[80vh] w-full max-w-5xl flex-col rounded-xl border border-frame-line glass-panel overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-line px-5 py-3.5 bg-surface-strong/30 shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-2.5",children:[h.jsx("span",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-chip-indigo-bg text-chip-indigo-text",children:h.jsx(eb,{className:"h-4 w-4"})}),h.jsxs("div",{children:[h.jsx("h2",{id:"workflow-runner-title",className:"text-sm font-semibold text-ink",children:"Launch Workflow Engine"}),h.jsxs("p",{className:"text-xs text-ink-muted",children:[u," ",m!=null&&m.pattern?`• Pattern: ${m.pattern}`:""]})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[m&&!W&&!T&&h.jsxs("button",{type:"button",disabled:!le||x,onClick:()=>R("bypass"),title:re?"Skip the remaining post-launch steps":"Skip the remaining steps and launch with the OS default app",className:"btn inline-flex items-center gap-1.5 rounded-md border border-line bg-surface px-3 py-1.5 text-xs font-medium text-status-warning-text hover:bg-status-warning-bg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 disabled:cursor-not-allowed disabled:opacity-40",children:[h.jsx(Fw,{className:"h-3.5 w-3.5"}),re?"Skip rest":"Launch now"]}),h.jsx("button",{type:"button",onClick:se,className:"rounded-md p-1.5 text-ink-muted hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:h.jsx(nl,{className:"h-4 w-4"})})]})]}),h.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[h.jsxs("div",{className:"w-72 border-r border-line bg-surface-strong/20 p-4 overflow-y-auto flex flex-col gap-2 shrink-0",children:[h.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-ink-muted px-1 mb-1",children:"Workflow Steps (Click to inspect)"}),m&&m.steps.length>0?h.jsx("ul",{role:"list",className:"flex flex-col gap-2",children:m.steps.map((E,Y)=>{const oe=m.current_index===Y&&!W,de=v===Y||v===null&&oe,je=L4[E.status];return h.jsx("li",{children:h.jsxs("button",{ref:ye=>{ne.current[Y]=ye},type:"button",tabIndex:de?0:-1,"aria-current":de?"step":void 0,onKeyDown:ye=>V(ye,Y),onClick:()=>S(Y),className:`flex items-start text-left gap-2.5 rounded-lg border px-3 py-2.5 transition-colors cursor-pointer w-full ${de?"border-chip-indigo-border bg-chip-indigo-bg shadow-xs ring-1 ring-chip-indigo-border/40":"border-line/60 bg-surface/60 hover:bg-elevated/80"}`,children:[h.jsxs("div",{className:"mt-0.5 shrink-0",children:[E.status==="running"&&h.jsx(Wi,{className:"h-4 w-4 animate-spin text-chip-indigo-text"}),E.status==="completed"&&h.jsx(Mx,{className:"h-4 w-4 text-status-success-text"}),E.status==="skipped"&&h.jsx(hw,{className:"h-4 w-4 text-status-warning-text"}),E.status==="failed"&&h.jsx(lu,{className:"h-4 w-4 text-status-danger-text"}),E.status==="pending"&&h.jsx("div",{className:"h-4 w-4 rounded-full border border-line-strong flex items-center justify-center text-[10px] text-ink-faint font-mono",children:E.index})]}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"font-mono text-[11px] font-bold uppercase text-chip-indigo-text",children:E.action}),h.jsxs("span",{className:"text-[10px] font-mono text-ink-faint",children:["#",E.index," · ",je]})]}),h.jsx("p",{className:"truncate font-mono text-[11px] text-ink-secondary mt-0.5",title:E.command,children:E.message?E.message.split(` +`)[0]:E.command}),E.note&&h.jsx("p",{className:"mt-1 text-[10px] text-ink-faint italic",children:E.note})]})]})},E.index)})}):h.jsx("div",{className:"p-4 text-center text-xs text-ink-faint",children:g||T?"Session unavailable — see the error panel.":"Loading steps..."})]}),h.jsxs("div",{className:"flex-1 flex flex-col bg-app",children:[h.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-6",children:h.jsx("div",{className:"space-y-6",children:h.jsxs("div",{className:"rounded-xl border border-line bg-surface p-5 shadow-xs space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"rounded bg-chip-indigo-bg px-2 py-0.5 font-mono text-xs font-semibold uppercase text-chip-indigo-text",children:(A==null?void 0:A.action)||(m==null?void 0:m.status)}),h.jsx("span",{className:"text-xs text-ink-muted",children:A?`Step ${A.index} of ${m==null?void 0:m.steps.length}`:"Status"}),v!==null&&v!==(m==null?void 0:m.current_index)&&h.jsx("button",{type:"button",onClick:()=>S(null),className:"text-[11px] text-chip-indigo-text hover:underline ml-2",children:"(Return to active step)"})]}),x&&h.jsx(Wi,{className:"h-4 w-4 animate-spin text-chip-indigo-text"})]}),h.jsxs("div",{className:"space-y-3 text-xs text-ink font-sans leading-relaxed",children:[(v===null||v===(m==null?void 0:m.current_index))&&(m==null?void 0:m.status)==="waiting_notify"&&m.notify_message&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Notification Message:"}),h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-ink",children:h.jsx($o,{text:m.notify_message})}),qe]}),(v===null||v===(m==null?void 0:m.current_index))&&(m==null?void 0:m.status)==="waiting_notice"&&m.notice_message&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Notice:"}),h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-ink",children:h.jsx($o,{text:m.notice_message})}),qe,h.jsx("p",{className:"text-[11px] text-ink-faint",children:"The command will run when you continue."})]}),(v===null||v===(m==null?void 0:m.current_index))&&(m==null?void 0:m.status)==="waiting_ask"&&m.ask_prompt&&h.jsxs("div",{className:"space-y-2",children:[m.ask_message&&h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-ink",children:h.jsx($o,{text:m.ask_message})}),h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-status-warning-text",children:"Confirmation Prompt:"}),h.jsx("div",{className:"rounded-lg border border-status-warning-border bg-status-warning-bg p-4 text-sm font-medium text-ink",children:m.ask_prompt}),qe]}),W&&v===null&&h.jsxs("div",{className:`rounded-xl border p-8 text-center space-y-4 ${(m==null?void 0:m.status)==="completed"?"border-status-success-border bg-status-success-bg text-status-success-text":"border-status-danger-border bg-status-danger-bg text-status-danger-text"}`,children:[h.jsx("div",{className:"inline-flex h-12 w-12 items-center justify-center rounded-full bg-surface/50 mx-auto",children:(m==null?void 0:m.status)==="completed"?h.jsx(Mx,{className:"h-6 w-6 text-status-success-text"}):h.jsx(lu,{className:"h-6 w-6 text-status-danger-text"})}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("h3",{className:"text-base font-bold",children:(m==null?void 0:m.status)==="completed"?"Workflow Finished":"Workflow Terminated"}),h.jsx("p",{className:"text-xs text-ink-secondary max-w-md mx-auto",children:(m==null?void 0:m.final_message)||"The launch sequence has ended."})]}),h.jsx("div",{className:"pt-2",children:h.jsx("button",{type:"button",onClick:r,className:"btn btn-primary px-8 py-2.5 font-bold shadow-lg",children:"Close Engine Runner"})})]}),W&&v===null&&(m==null?void 0:m.last_output)&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Command Output:"}),h.jsxs("div",{className:"relative",children:[h.jsx(Jo,{text:m.last_output}),h.jsx("pre",{className:"max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-line bg-surface-strong p-4 font-mono text-xs text-ink",children:m.last_output})]})]}),!T&&!(W&&v===null)&&!((v===null||v===(m==null?void 0:m.current_index))&&((m==null?void 0:m.status)==="waiting_notify"||(m==null?void 0:m.status)==="waiting_ask"||(m==null?void 0:m.status)==="waiting_notice"))&&h.jsxs("div",{className:"space-y-4",children:[(A==null?void 0:A.message)&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Message:"}),h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-xs text-ink",children:h.jsx($o,{text:A.message})})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Command:"}),h.jsx("div",{className:"relative rounded-lg border border-line bg-surface-strong p-4 font-mono text-xs text-ink leading-relaxed",children:A!=null&&A.command?h.jsxs(h.Fragment,{children:[h.jsx(Jo,{text:A.command}),h.jsx("span",{className:"block pr-8",children:A.command})]}):"Waiting..."})]}),(A==null?void 0:A.output)&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Output:"}),h.jsxs("div",{className:"relative",children:[h.jsx(Jo,{text:A.output}),h.jsx("pre",{className:"max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-line bg-surface-strong p-4 font-mono text-xs text-ink",children:A.output})]})]}),(A==null?void 0:A.ask)&&h.jsxs("div",{className:"rounded-lg border border-status-warning-border bg-status-warning-bg p-3 text-xs text-status-warning-text",children:[h.jsx("span",{className:"font-semibold",children:"Workflow Guard:"})," ",A.ask]}),(A==null?void 0:A.note)&&h.jsxs("div",{className:"rounded-lg border border-line bg-surface-strong p-3 text-xs text-ink-muted italic",children:[h.jsx("span",{className:"font-semibold text-ink-secondary not-italic uppercase text-[10px]",children:"Log:"})," ",A.note]})]})]})]})})}),(g||T)&&h.jsx("div",{className:"shrink-0 px-6 pt-3",children:h.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-status-danger-border bg-status-danger-bg p-3 text-xs text-status-danger-text",children:[h.jsx(lu,{className:"mt-0.5 h-4 w-4 shrink-0"}),h.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[h.jsx("p",{children:T?"Workflow session on the server has expired or ended.":g}),T?h.jsxs("div",{className:"space-y-2",children:[g&&h.jsxs("details",{className:"text-ink-muted",children:[h.jsx("summary",{className:"cursor-pointer select-none text-[11px] underline",children:"Raw error (for bug reports)"}),h.jsx("pre",{className:"mt-1 overflow-x-auto whitespace-pre-wrap break-words font-mono text-[11px]",children:g})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{type:"button",onClick:ve,className:"btn btn-primary px-4 py-1.5 text-xs font-semibold",children:"Restart workflow"}),h.jsx("button",{type:"button",onClick:se,className:"btn rounded-md border-line bg-surface px-4 py-1.5 text-xs",children:"Close"})]})]}):null]})]})}),h.jsxs("div",{className:"shrink-0 px-6 pt-4 pb-4 border-t border-line flex items-center justify-between bg-app",children:[h.jsx("div",{className:"text-xs text-ink-muted","aria-live":"polite",children:T?"Session unavailable — restart or close above.":(m==null?void 0:m.status)==="waiting_ask"&&(v===null||v===m.current_index)?"Action required to proceed:":(m==null?void 0:m.status)==="waiting_notify"&&(v===null||v===m.current_index)?"Acknowledge message to proceed:":(m==null?void 0:m.status)==="waiting_notice"&&(v===null||v===m.current_index)?"Continue to run the command:":W?"Session terminated.":"Step in progress..."}),h.jsxs("div",{className:"flex items-center gap-2",children:[!T&&(m==null?void 0:m.status)==="waiting_notice"&&(v===null||v===m.current_index)&&h.jsxs("button",{type:"button",ref:ie,disabled:x,onClick:()=>R("ack"),className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:["Run Command",h.jsx(tu,{label:"↵"})]}),!T&&(m==null?void 0:m.status)==="waiting_notify"&&(v===null||v===m.current_index)&&h.jsxs("button",{type:"button",ref:ie,disabled:x,onClick:()=>R("ack"),className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:["Continue Workflow",h.jsx(tu,{label:"↵"})]}),!T&&(m==null?void 0:m.status)==="waiting_ask"&&(v===null||v===m.current_index)&&h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",disabled:x,onClick:()=>R("no"),className:"btn rounded-md border-line bg-surface px-4 py-2 text-status-danger-text hover:bg-status-danger-bg",children:["Abort Launch",h.jsx(tu,{label:"N"})]}),h.jsxs("button",{type:"button",disabled:x,onClick:()=>R("skip"),className:"btn rounded-md border-line bg-surface px-4 py-2 text-status-warning-text hover:bg-status-warning-bg",children:["Skip Step",h.jsx(tu,{label:"S"})]}),h.jsxs("button",{type:"button",ref:ie,disabled:x,onClick:()=>R("yes"),className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:["Execute Step",h.jsx(tu,{label:"Y"})]})]}),W&&h.jsx("button",{type:"button",ref:ie,onClick:r,className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:"Close Runner"})]})]})]})]})]})})}function Ly({isOpen:n,title:r,message:a,confirmLabel:u="Confirm",cancelLabel:s="Cancel",danger:d=!1,onConfirm:f,onCancel:m}){const p=_.useRef(null),x=_.useRef(null),y=Wr({isOpen:n,onClose:m,dialogRef:p,initialFocusRef:x});return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",onClick:m,children:h.jsxs("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",onKeyDown:y,onClick:g=>g.stopPropagation(),className:"animate-modal-in w-[400px] max-w-full rounded-2xl border border-frame-line glass-panel p-5",children:[h.jsxs("div",{className:"mb-3 flex items-center gap-2.5",children:[h.jsx("span",{className:`grid h-9 w-9 shrink-0 place-items-center rounded-lg ${d?"bg-status-danger-bg text-status-danger-text":"bg-chip-indigo-bg text-chip-indigo-text"}`,children:h.jsx(Wy,{className:"h-5 w-5"})}),h.jsx("h2",{id:"confirm-dialog-title",className:"text-sm font-semibold text-ink",children:r})]}),h.jsx("p",{className:"mb-5 whitespace-pre-line text-xs text-ink-secondary",children:a}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx("button",{ref:x,type:"button",onClick:m,className:"min-h-9 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:s}),h.jsx("button",{type:"button",onClick:f,className:`min-h-9 rounded-lg border px-4 text-sm font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400 ${d?"border-status-danger-border bg-status-danger-bg/30 text-status-danger-text hover:bg-status-danger-bg/60":"btn-primary border-transparent bg-indigo-600 text-white hover:bg-indigo-500"}`,children:u})]})]})}):null}const B4=";",Uy="=";function H4(n){const r=n.trim().toLowerCase();return r==="extension"||r==="file_ext"||r==="filetype"?"ext":r==="directory"||r==="path"||r==="folder"?"dir":r==="recurse"||r==="recursive_search"?"recursive":r==="filter_text"||r==="query"||r==="search"?"filter":r}function By(n){const r=n.trim();if(!r.includes(Uy))return{values:{filter:r},isPlainFilter:!0};const a={};for(const u of r.split(B4)){const s=u.trim();if(!s)continue;const d=s.indexOf(Uy);if(d===-1)continue;const f=H4(s.slice(0,d)),m=s.slice(d+1).trim();switch(f){case"filter":a.filter=m;break;case"ext":a.ext=m;break;case"recursive":a.recursive=Hy(m,!0);break;case"dir":a.dir=m;break;case"scan":a.scan=Hy(m,!1);break}}return{values:a,isPlainFilter:!1}}function Hy(n,r){const a=n.toLowerCase();return["0","false","no","off"].includes(a)?!1:["1","true","yes","on"].includes(a)?!0:r}function nu(n){return/[",\n\r]/.test(n)?`"${n.replace(/"/g,'""')}"`:n}function q4(n,r,a,u){var p,x;const s=[],f=[["Exported",new Date().toISOString()],["App Version",(a==null?void 0:a.release)??"unknown"],["Config File",(a==null?void 0:a.config_path)??"none"],["Config Exists",String((a==null?void 0:a.config_exists)??!1)],["Directory",(a==null?void 0:a.active_directory)??""],["Extensions",((p=a==null?void 0:a.extensions)==null?void 0:p.join(" | "))??""],["Filter Text",u??((x=a==null?void 0:a.filters)==null?void 0:x[0])??""],["Recursive",String((a==null?void 0:a.recursive_search)??!0)],["Title",(a==null?void 0:a.title)??""],["Release",(a==null?void 0:a.release)??""]];for(const[y,g]of f)s.push(`${nu(y)},${nu(g)}`);s.push("");const m=r.length>0?r:["filename","path","rel_path"];s.push(m.map(nu).join(","));for(const y of n){const g=m.map(w=>w in y?nu(String(y[w]??"")):nu(y.column_values[w]??""));s.push(g.join(","))}return s.join(`\r +`)}const F4=120,qy=800,V4=4e3,Fy=20;function Y4(){const[n,r]=_.useState("dark"),[a,u]=_.useState(null),[s,d]=_.useState(null),[f,m]=_.useState(""),[p,x]=_.useState(""),[y,g]=_.useState(""),[w,v]=_.useState(!0),[S,T]=_.useState([]),[L,D]=_.useState(0),[$,I]=_.useState(!1),[J,ie]=_.useState(!1),[U,R]=_.useState(null),[Q,fe]=_.useState(!1),[B,ne]=_.useState(null),[V,se]=_.useState(0),[ve,ae]=_.useState(!1),A=_.useRef(0),W=_.useRef(null),le=_.useRef(null),[re,N]=_.useState(""),[qe,Ge]=_.useState(null),[M,E]=_.useState(!1),[Y,oe]=_.useState(null),[de,je]=_.useState(!1),[ye,_e]=_.useState("en"),[pe,Se]=_.useState(!1),[Rt,Bt]=_.useState(!1),[Gt,St]=_.useState(!1),[nt,Je]=_.useState(null),[en,bn]=_.useState(null),[tn,Ht]=_.useState(!1),[ge,Me]=_.useState(!1),[Le,lt]=_.useState(null),[K,ue]=_.useState(null),[ke,Ce]=_.useState(!1),ft=_.useRef(""),[it,Tt]=_.useState(!1),[nn,zn]=_.useState(void 0),[Dn,Mn]=_.useState(!1),[ll,Nt]=_.useState(null),[Et,Gn]=_.useState(0),Qt=_.useRef(null),il=_.useRef(null),he=(z,C="info")=>{z&&(oe({message:z,kind:C}),il.current&&clearTimeout(il.current),il.current=setTimeout(()=>oe(null),C==="error"?1e4:3500))},fu=()=>{il.current&&clearTimeout(il.current),oe(null)},xs=z=>{lt(z)},vn=()=>{var C;le.current&&(clearTimeout(le.current),le.current=null),(C=W.current)==null||C.abort(),W.current=new AbortController;const z=++A.current;return ae(!0),ie(!1),z},pt=z=>z===A.current,gt=z=>{pt(z)&&ae(!1)},jt=_.useRef(null);_.useEffect(()=>{if(!y.trim()){N("");return}const z=window.setTimeout(()=>N(y),F4);return()=>window.clearTimeout(z)},[y]);const Ke=_.useMemo(()=>re.trim()===""?S:S.filter(z=>Nk(z.rel_path,re)),[S,re]),ys=y.trim()&&S.length{const z=jt.current,C=z?Ke.findIndex(P=>P.path===z):-1;if(C>=0){se(P=>C!==P?C:P);return}se(P=>Math.min(P,Math.max(0,Ke.length-1)))},[Ke]);const du=async(z,C=B)=>{var we;const P=await Pf({offset:0,limit:ed,sort_by:C==null?void 0:C.column,sort_dir:C==null?void 0:C.direction,signal:(we=W.current)==null?void 0:we.signal});return pt(z)?(T(P.items),D(P.count),I(!0),!0):!1},On=async(z,C)=>{var P;return!pt(z)||(await Ex(C,(P=W.current)==null?void 0:P.signal),!pt(z)||!await du(z))?!1:(jt.current=null,se(0),!0)},lr=async()=>{if(J||S.length>=L)return;const z=A.current;ie(!0);try{const C=await Pf({offset:S.length,limit:ed,sort_by:B==null?void 0:B.column,sort_dir:B==null?void 0:B.direction});if(!pt(z))return;const P=new Set(S.map(we=>we.path||we.filename));T(we=>[...we,...C.items.filter(Oe=>!P.has(Oe.path||Oe.filename))]),D(C.count)}catch{he("Couldn't load more results — scroll to try again.","error")}finally{pt(z)&&ie(!1)}},Si=async()=>{if(de)return;je(!0),he("Reloading configuration...");const z=vn();try{const C=await Po();u(C);const P=await h2();d(P),r(zx(P.theme));const we=P.active_directory||f,Oe=P.extensions[0]??"",Ye=P.filters[0]??"";we&&m(we),x(Oe),g(Ye),v(P.recursive_search),P.reloaded===!1?he(`Config file not found: ${P.config_path||"(unknown path)"} — kept current configuration.`,"error"):he("Configuration reloaded."),we&&await On(z,{directory:we,extension:Oe,filter_text:Ye,recursive:P.recursive_search})}catch(C){he(`Failed to reload configuration: ${C.message}`,"error")}finally{je(!1),gt(z)}},ql=async z=>{const C=vn();d(z),r(zx(z.theme));const P=z.active_directory||f||(z.directories[0]??""),we=z.extensions[0]??"",Oe=z.filters[0]??"";if(P&&m(P),x(we),g(Oe),v(z.recursive_search),z.session_trial||he(z.config_exists?`Loaded config: ${z.config_path}`:"Starter configuration created."),P)try{await On(C,{directory:P,extension:we,filter_text:Oe,recursive:z.recursive_search})}catch(Ye){he(`Scan failed after config load: ${Ye.message}`,"error")}finally{gt(C)}else gt(C)},[wl,ir]=_.useState(!1),kl=_.useRef(Wo()),Ni=z=>{kl.current=z,ir(z.overlayVisible)},na=_.useRef(()=>{}),hu=async z=>{try{const C=await z.text(),P=await d2(z.name,C);await ql(P),he(`Session config applied: ${z.name}`)}catch(C){he(C.message||"Failed to apply dropped configuration","error")}};na.current=z=>{hu(z)};const Ei=_.useRef(0),Fl=_.useRef(async()=>{});_.useEffect(()=>{Fl.current=async()=>{const z=await Sx();await ql(z)}}),_.useEffect(()=>{const z=async()=>{let P=[];try{P=(await a2(Ei.current)).events}catch{return}for(const we of P){if(Ei.current=Math.max(Ei.current,we.id),we.config_applied)try{await Fl.current()}catch{}he(we.message)}},C=setInterval(()=>void z(),V4);return()=>clearInterval(C)},[]),_.useEffect(()=>{const z=Ye=>{var qt;return Array.from(((qt=Ye.dataTransfer)==null?void 0:qt.types)??[]).includes("Files")},C=Ye=>{Ni(Ax(kl.current,"enter",z(Ye)))},P=Ye=>{z(Ye)&&Ye.preventDefault()},we=Ye=>{Ni(Ax(kl.current,"leave",z(Ye)))},Oe=Ye=>{var Qe;Ye.preventDefault(),Ni(Wo());const qt=Array.from(((Qe=Ye.dataTransfer)==null?void 0:Qe.files)??[]),Re=C2(qt);if(!Re){qt.length>0&&he("Not a ProFiles configuration file.","error");return}na.current(Re)};return window.addEventListener("dragenter",C),window.addEventListener("dragover",P),window.addEventListener("dragleave",we),window.addEventListener("drop",Oe),()=>{window.removeEventListener("dragenter",C),window.removeEventListener("dragover",P),window.removeEventListener("dragleave",we),window.removeEventListener("drop",Oe)}},[]);const bs=()=>{Se(!0)},mu=async z=>{const C=vn();Se(!1),m(z),he(`Directory selected: ${z}`);let P;try{P=await Nx(z),d(P)}catch(Ye){console.error("select-directory failed:",Ye)}if(!pt(C))return;const we=P!=null&&P.extensions.includes(p)?p:(P==null?void 0:P.extensions[0])??p,Oe=P!=null&&P.filters.includes(y)?y:(P==null?void 0:P.filters[0])??y;x(we),g(Oe);try{await On(C,{directory:z,extension:we,filter_text:Oe,recursive:w})}catch(Ye){pt(C)&&he(`Scan failed: ${Ye.message}`,"error")}finally{gt(C)}},pu=async(z,C)=>{if(!pt(C))return;const P=z.theme==="auto"?"dark":z.theme==="light"?"light":"dark";r(P);try{localStorage.setItem("profiles-theme",P)}catch{}d(z);const we=z.active_directory||(z.directories.length>0?z.directories[0]:""),Oe=z.extensions.length>0?z.extensions[0]:"",Ye=z.filters.length>0?z.filters[0]:"";if(we&&m(we),Oe&&x(Oe),z.recursive_search!==void 0&&v(z.recursive_search),Ye&&g(Ye),z.config_exists||Bt(!0),we)try{await On(C,{directory:we,extension:Oe,filter_text:Ye,recursive:z.recursive_search})}catch(qt){pt(C)&&he(`Initial scan failed: ${qt.message}`,"error")}},la=async()=>{var C;(C=W.current)==null||C.abort(),W.current=new AbortController;const z=++A.current;R(null),fe(!0);try{const P=await Po();u(P);const we=await Sx();await pu(we,z)}catch(P){R((P==null?void 0:P.message)||"Couldn't fetch system info or configuration.")}finally{fe(!1)}};_.useEffect(()=>{la()},[]),_.useEffect(()=>()=>{var z;le.current&&(clearTimeout(le.current),le.current=null),(z=W.current)==null||z.abort()},[]);const Vl=async z=>{const C=vn();m(z);try{const P=await Nx(z);if(!pt(C))return;d(P);const we=P.extensions.includes(p)?p:P.extensions[0]??"",Oe=P.filters.includes(y)?y:P.filters[0]??"";x(we),g(Oe),await On(C,{directory:z,extension:we,filter_text:Oe,recursive:w})}catch(P){pt(C)&&he(`Directory change failed: ${P.message}`,"error")}finally{gt(C)}},rl=async()=>{if(!f)return;const z=vn();try{await On(z,{directory:f,extension:p,filter_text:y,recursive:w})}catch(C){pt(z)&&he(`Scan failed: ${(C==null?void 0:C.message)??C}`,"error")}finally{gt(z)}},Sl=_.useRef(rl);_.useEffect(()=>{Sl.current=rl});const gu=z=>{g(z),le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{le.current=null,Sl.current()},qy)},Qn=z=>{v(z),le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{le.current=null,Sl.current()},qy)},Lt=async()=>{if(g(""),!f)return;const z=vn();try{await On(z,{directory:f,extension:p,filter_text:"",recursive:w})}catch(C){pt(z)&&he(`Scan failed: ${(C==null?void 0:C.message)??C}`,"error")}finally{gt(z)}},ln=async()=>{if(v(!1),!f)return;const z=vn();try{await On(z,{directory:f,extension:p,filter_text:y,recursive:!1})}catch(C){pt(z)&&he(`Scan failed: ${C.message}`,"error")}finally{gt(z)}},wn=async(z,C)=>{if(z.has_hook){ue({file:z,args:C});return}try{await x2({directory:f,filename:z.rel_path,release:s==null?void 0:s.release,args:C}),he(`Launched ${z.filename}`)}catch(P){he(`Launch error: ${P.message}`,"error")}},ia=()=>{Ke.length>0&&Ke[V]&&wn(Ke[V])},vs=z=>{var C;jt.current=((C=Ke[z])==null?void 0:C.path)??null,se(z)},ws=async(z,C)=>{wn(z,C)},xu=async z=>{try{await Yy(z.path),he("Revealed in file manager.")}catch(C){he(`Error: ${C.message}`,"error")}},ji=async z=>{try{await yd(z.path),he("Folder opened in file manager.")}catch(C){he(`Error: ${C.message}`,"error")}},rr=async z=>{try{const C=await jx(z.path);he(C.message||"Terminal opened.")}catch(C){he(`Error: ${C.message}`,"error")}},ar=async z=>{try{await Vl(z),he(`Scanned directory: ${z}`)}catch(C){he(`Error: ${C.message}`,"error")}},Nl=z=>{g(z);const C=vn();On(C,{directory:f,extension:p,filter_text:z,recursive:w}).catch(P=>{pt(C)&&he(`Scan failed: ${(P==null?void 0:P.message)??P}`,"error")}).finally(()=>gt(C))},Yl=z=>{x(z);const C=vn();On(C,{directory:f,extension:z,filter_text:y,recursive:w}).catch(P=>{pt(C)&&he(`Scan failed: ${(P==null?void 0:P.message)??P}`,"error")}).finally(()=>gt(C))},Ci=async(z,C)=>{const P=C?z.path.replace(/\\/g,"/"):z.path;try{await navigator.clipboard.writeText(P),he("Path copied to clipboard.")}catch(we){he(`Copy failed: ${(we==null?void 0:we.message)??we}`,"error")}},Gl=async(z,C)=>{let P=z.filename;if(C){const we=P.lastIndexOf(".");we!==-1&&(P=P.slice(0,we))}try{await navigator.clipboard.writeText(P),he("Filename copied to clipboard.")}catch(we){he(`Copy failed: ${(we==null?void 0:we.message)??we}`,"error")}},_t=async(z,C)=>{try{he(`Computing ${C.toUpperCase()}...`);const P=await Cx(z.path,C);await navigator.clipboard.writeText(P.hash),he(`${C.toUpperCase()} hash copied: ${P.hash.slice(0,12)}...`)}catch(P){he(`Hash computation failed: ${P.message}`,"error")}},yu=async z=>{try{const C=new URL("file:///").href+z.path.replace(/\\/g,"/");await navigator.clipboard.writeText(C),he("File URI copied to clipboard.")}catch(C){he(`URI copy failed: ${C.message}`,"error")}},bu=async(z,C)=>{try{const P=await navigator.clipboard.readText();if(!P.trim()){he("Clipboard is empty — copy a hash first, then try again.");return}he(`Computing ${C.toUpperCase()}...`);const Oe=(await Cx(z.path,C)).hash.toLowerCase()===P.trim().toLowerCase();he(Oe?`✅ ${C.toUpperCase()} matches!`:`❌ ${C.toUpperCase()} mismatch`)}catch(P){he(`Verification failed: ${P.message}`,"error")}},ra=z=>{bn(z),St(!0)},El=z=>{Je(z)},Ql=async()=>{const z=nt;if(Je(null),!!z)try{if(he("Deleting file..."),!(await fetch("/api/actions/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:z.path})})).ok)throw new Error("Failed to delete file");he("File deleted successfully."),rl()}catch(C){he(`Delete failed: ${C.message}`,"error")}},ks=z=>{zn(z.path),Tt(!0)},aa=async()=>{if(f)try{await yd(f),he("Directory opened in file manager.")}catch(z){he(`Error: ${z.message}`,"error")}},vu=async z=>{if(z)try{await jx(z),he("Terminal opened in directory.")}catch(C){he(`Error: ${C.message}`,"error")}},wu=async()=>{try{await Vl("~"),he("Directory set to home folder.")}catch(z){he(`Error: ${z.message}`,"error")}},Pe=async()=>{if(f)try{const z=await g2(f);z.parent_path?(await Vl(z.parent_path),he("Moved to parent directory.")):he("Already at root directory.")}catch(z){he(`Error: ${z.message}`,"error")}},ku=async()=>{if(S.length===0){he("No files to export.");return}try{const z=q4(S,(s==null?void 0:s.column_names)||[],s??void 0,y),C=`profiles-export-${new Date().toISOString().slice(0,19).replace(/[:.]/g,"-")}.csv`,P=await v2(z,C);he(`Exported ${S.length} loaded row${S.length===1?"":"s"}${y?` matching "${y}"`:""} — ${P.message}`)}catch(z){he(`Export failed: ${z.message}`,"error")}},ur=async z=>{var Re,Qe;Mn(!1),he("Barcode detected!");const P=By(z).values,we=P.dir!==void 0?P.dir:f,Oe=P.ext!==void 0?P.ext:p,Ye=P.filter!==void 0?P.filter:y,qt=P.recursive!==void 0?P.recursive:w;if(P.dir!==void 0&&m(P.dir),P.ext!==void 0&&x(P.ext),P.filter!==void 0&&g(P.filter),P.recursive!==void 0&&v(P.recursive),we){const at=vn();try{await Ex({directory:we,extension:Oe,filter_text:Ye,recursive:qt},(Re=W.current)==null?void 0:Re.signal);const al=await Pf({offset:0,limit:ed,sort_by:B==null?void 0:B.column,sort_dir:B==null?void 0:B.direction,signal:(Qe=W.current)==null?void 0:Qe.signal});if(!pt(at))return;T(al.items),D(al.count),I(!0),jt.current=null,se(0),al.count===1&&al.items.length===1&&Nt(al.items[0])}catch(al){pt(at)&&he(`Scan error: ${al.message}`,"error")}finally{gt(at)}}},or=()=>{Ce(z=>{const C=!z;return C?(ft.current="",he("Barcode mode ON — scan a barcode now.")):(ft.current="",he("Barcode mode OFF.")),C})},Xn=z=>{z.filter!==void 0&&g(z.filter),z.ext!==void 0&&x(z.ext),z.recursive!==void 0&&v(z.recursive),z.dir!==void 0&&m(z.dir),(z.scan===!0||z.filter!==void 0||z.ext!==void 0||z.recursive!==void 0||z.dir!==void 0)&&(Ce(!1),ft.current="",setTimeout(()=>{Sl.current()},50))};_.useEffect(()=>{if(!ke)return;const z=C=>{const P=C.target;if(!(P instanceof HTMLElement&&(P.isContentEditable||P instanceof HTMLInputElement||P instanceof HTMLTextAreaElement||P instanceof HTMLSelectElement)))if(C.key==="Enter"){const Oe=ft.current;if(!Oe){ft.current="";return}C.preventDefault(),ft.current="";const Ye=By(Oe);if(Ye.isPlainFilter)he(`Barcode filter: ${Ye.values.filter}`),g(Ye.values.filter||""),Ce(!1),setTimeout(()=>void Sl.current(),50);else{const qt=Ye.values,Re=Object.entries(qt).map(([Qe,at])=>`${Qe}=${at}`).join(", ");he(`Barcode applied: ${Re}`),Xn(qt)}}else C.key==="Escape"?(Ce(!1),ft.current="",he("Barcode mode cancelled.")):C.key.length===1&&!C.ctrlKey&&!C.metaKey&&!C.altKey&&(ft.current+=C.key)};return document.addEventListener("keydown",z,!0),()=>document.removeEventListener("keydown",z,!0)},[ke]),_.useEffect(()=>(Et>0&&(Qt.current=setInterval(()=>{Sl.current()},Et*1e3)),()=>{Qt.current&&(clearInterval(Qt.current),Qt.current=null)}),[Et]);const un=z=>{Gn(z),z>0?he(`Auto-rescan every ${z}s.`):he("Auto-rescan disabled.")},ua=!!(qe||M||pe||Rt||Gt||tn||ge||it||Dn||ll||K||nt);return _.useEffect(()=>{const z=C=>{var we,Oe,Ye,qt;if(C.key==="Escape"){Ge(null),E(!1),Ht(!1),Me(!1),Ni(Wo());return}if(ua)return;if(C.ctrlKey&&!C.shiftKey&&C.key.toLowerCase()==="l"){C.preventDefault(),(we=document.querySelector("[data-testid='file-list']"))==null||we.focus();return}const P=C.target;if(!(P instanceof HTMLElement&&P.closest("button, a, [role='menuitem'], [role='option'], [role='columnheader'], [role='separator']"))){if(P instanceof HTMLInputElement||P instanceof HTMLSelectElement){C.key==="Enter"&&rl();return}if(C.key==="ContextMenu"||C.shiftKey&&C.key==="F10"){const Re=Ke[V];if(!Re)return;C.preventDefault();const Qe=document.querySelector(`[data-row-index="${V}"]`),at=Qe==null?void 0:Qe.getBoundingClientRect();Ge({x:at?at.left+24:24,y:at?at.top+at.height/2:24,file:Re});return}if(C.key==="F5"){C.preventDefault(),rl();return}if(C.ctrlKey&&C.key.toLowerCase()==="r"){C.preventDefault(),Si();return}if(C.ctrlKey&&C.key.toLowerCase()==="d"){C.preventDefault(),(Oe=document.querySelector("#directory-combobox"))==null||Oe.focus();return}if(C.ctrlKey&&C.key.toLowerCase()==="e"){C.preventDefault(),(Ye=document.querySelector("#extension-combobox"))==null||Ye.focus();return}if(C.ctrlKey&&C.key.toLowerCase()==="f"){C.preventDefault(),(qt=document.querySelector("#filter-combobox"))==null||qt.focus();return}if(C.ctrlKey&&C.shiftKey&&C.key.toLowerCase()==="l"){C.preventDefault(),Ht(Re=>!Re);return}if(C.ctrlKey&&C.key===","){C.preventDefault(),Tx().then(Re=>he(Re.message));return}if(C.ctrlKey&&C.shiftKey&&C.key.toLowerCase()==="t"){C.preventDefault(),r(Re=>Re==="dark"?"light":"dark");return}if(C.ctrlKey&&!C.shiftKey&&C.key.toLowerCase()==="b"){C.preventDefault(),Ce(Re=>!Re);return}if(C.ctrlKey&&C.shiftKey&&C.key.toLowerCase()==="b"){C.preventDefault(),Mn(Re=>!Re);return}if(C.ctrlKey&&!C.shiftKey&&C.key.toLowerCase()==="t"){C.preventDefault(),Me(!0);return}if(C.ctrlKey&&!C.shiftKey&&C.key.toLowerCase()==="h"){C.preventDefault(),wu();return}if(C.key==="?"||C.ctrlKey&&C.key==="/"){C.preventDefault(),E(Re=>!Re);return}if(C.key.toLowerCase()==="p"&&!C.ctrlKey&&!C.shiftKey&&!C.altKey){const Re=Ke[V];Re&&(C.preventDefault(),ra(Re));return}C.key==="ArrowDown"?(C.preventDefault(),se(Re=>{var at;const Qe=Math.min(Re+1,Math.max(0,Ke.length-1));return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Qe})):C.key==="ArrowUp"?(C.preventDefault(),se(Re=>{var at;const Qe=Math.max(Re-1,0);return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Qe})):C.key==="Home"?(C.preventDefault(),se(Re=>{var Qe;return jt.current=((Qe=Ke[0])==null?void 0:Qe.path)??null,Re===0?Re:0})):C.key==="End"?(C.preventDefault(),se(Re=>{var at;const Qe=Math.max(0,Ke.length-1);return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Re===Qe?Re:Qe})):C.key==="PageUp"?(C.preventDefault(),se(Re=>{var at;const Qe=Math.max(Re-Fy,0);return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Qe})):C.key==="PageDown"?(C.preventDefault(),se(Re=>{var at;const Qe=Math.min(Re+Fy,Math.max(0,Ke.length-1));return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Qe})):C.key==="Enter"&&(C.preventDefault(),ia())}};return window.addEventListener("keydown",z),()=>window.removeEventListener("keydown",z)},[ua,Ke,V,f,p,y,w,ke]),_.useEffect(()=>{document.documentElement.setAttribute("data-theme",n);try{localStorage.setItem("profiles-theme",n)}catch{}},[n]),h.jsxs("div",{className:"flex h-dvh flex-col bg-elevated/30 p-1 font-sans text-ink transition-colors duration-200 sm:p-1.5",children:[h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-frame-line bg-app shadow-[0_2px_6px_rgb(0_0_0/0.35)] transition-colors duration-200 sm:rounded-xl",children:[h.jsx(xk,{title:(s==null?void 0:s.title)||"",release:(s==null?void 0:s.release)||"",directories:(s==null?void 0:s.directories)||[],activeDirectory:f,onDirectoryChange:Vl,onBrowseDirectory:bs,onGoToParentDirectory:Pe,onGoToHomeDirectory:wu,onOpenActiveDirectory:aa,onOpenTerminal:vu}),h.jsx(jk,{extensions:(s==null?void 0:s.extensions)||[],activeExtension:p,onExtensionChange:x,filterOptions:(s==null?void 0:s.filters)||[],filterText:y,onFilterTextChange:gu,recursive:w,onRecursiveChange:Qn,onScan:rl,scanning:ve,barcodeMode:ke,onBarcodeToggle:or,onCameraBarcodeClick:()=>Mn(!0),autoRescanActive:Et>0,onTimerClick:()=>Me(!0)}),U?h.jsx(yk,{message:U,onRetry:()=>void la(),retrying:Q}):h.jsx(gk,{files:Ke,totalCount:L,rawLoadedCount:S.length,onLoadMore:lr,loadingMore:J,scanning:ve,hasScanned:$,activeDirectory:f,recursive:w,onDisableRecursive:ln,onOpenDirectory:aa,onOpenConfig:()=>Bt(!0),filterText:y,onClearFilter:Lt,columnHeaders:(s==null?void 0:s.column_headers)||[],columnNames:(s==null?void 0:s.column_names)||[],selectedIndex:V,onSelectIndex:vs,prefilterNote:ys,onLaunch:wn,onContextMenu:(z,C,P)=>{z.preventDefault(),jt.current=C.path,se(P),Ge({x:z.clientX,y:z.clientY,file:C})},rowColors:(s==null?void 0:s.row_colors)||[],sort:B,onSortChange:z=>{ne(z),jt.current=null,se(0);const C=vn();du(C,z).catch(P=>{pt(C)&&he(`Sort failed: ${P.message}`,"error")}).finally(()=>gt(C))}}),h.jsx(ak,{onExecute:ia,scanning:ve,scanningDirectory:f,hasSelection:Ke.length>0,fileCount:Ke.length,totalCount:L,toastMessage:Y,onToastDismiss:fu}),h.jsx(Ik,{systemInfo:a,fileCount:L,theme:n,onToggleTheme:()=>r(z=>z==="dark"?"light":"dark"),onOpenLog:()=>Ht(!0),onOpenConfig:async()=>{try{const z=await Tx();he(z.message)}catch(z){he(`Failed to open config: ${z.message}`,"error")}},onLoadConfig:()=>Bt(!0),onShowShortcuts:()=>E(!0),onReloadConfig:Si,onExport:ku,exportDisabled:S.length===0||ve,language:ye,onLanguageChange:_e,activeConfigName:s!=null&&s.config_path?s.config_path.split(/[\\/]/).pop()||s.config_path:void 0,lanEnabled:(a==null?void 0:a.lan_enabled)??null,onToggleLan:xs})]}),h.jsx(Dk,{isOpen:Rt,activeConfigPath:s==null?void 0:s.config_path,configExists:s==null?void 0:s.config_exists,onClose:()=>Bt(!1),onLoaded:ql}),h.jsx(mk,{visible:wl,onFileSelected:z=>na.current(z)}),h.jsx(hk,{isOpen:pe,initialPath:f,onClose:()=>Se(!1),onSelect:mu}),h.jsx(uk,{position:qe,onClose:()=>Ge(null),onLaunch:wn,onLaunchWithArgs:ws,onReveal:xu,onOpenFolder:ji,onOpenTerminal:rr,onScanDirectory:ar,onFilterFolder:Nl,onFilterExtension:Yl,onCopyPath:Ci,onCopyFilename:Gl,onCopyUri:yu,onComputeHash:_t,onVerifyHash:bu,onProperties:ra,onClearFile:El,onGenerateBarcode:ks,showToast:he}),h.jsx(zk,{isOpen:M,onClose:()=>E(!1)}),h.jsx(Uk,{isOpen:Gt,file:en,onLaunch:wn,onClose:()=>{St(!1),bn(null)}}),h.jsx(Zk,{isOpen:ge,currentInterval:Et,onClose:()=>Me(!1),onSetInterval:un}),h.jsx(Ak,{isOpen:tn,onClose:()=>Ht(!1),onOpenExternally:()=>{u2().then(z=>he(z.message))}}),h.jsx(U4,{isOpen:!!K,onClose:()=>ue(null),directory:f,filename:(K==null?void 0:K.file.rel_path)||"",release:s==null?void 0:s.release,args:K==null?void 0:K.args,onFinished:(z,C)=>{z==="completed"?he(C||"Workflow launched successfully."):(z==="aborted"||z==="failed")&&he(`Workflow stopped: ${C}`,"error")}}),h.jsx(nb,{isOpen:it,onClose:()=>{Tt(!1),zn(void 0)},initialFilePath:nn}),h.jsx(Qk,{isOpen:Dn,onClose:()=>Mn(!1),onDetected:ur}),h.jsx(Ly,{isOpen:!!nt,title:"Delete file",message:`Delete this file? ${(nt==null?void 0:nt.path)??""} This action cannot be undone.`,confirmLabel:"Delete",danger:!0,onConfirm:Ql,onCancel:()=>Je(null)}),h.jsx(Ly,{isOpen:Le!==null,title:Le?"Enable LAN access?":"Restrict to this machine?",message:Le?`ProFiles will be reachable by anyone on this network: http://${a==null?void 0:a.hostname}:${window.location.port} -http://${a==null?void 0:a.ip}:${window.location.port}`:"ProFiles will be reachable only on this machine.",confirmLabel:Le?"Enable LAN":"Restrict",onConfirm:async()=>{const D=Le;lt(null);try{await s2(D);const T=await Vo();u(T),he(D?"ProFiles is now reachable on the local network.":"ProFiles is restricted to this machine.","info")}catch(T){const P=T instanceof Error?T.message:"Failed to update LAN binding";he(`Failed to update LAN binding: ${P}`,"error");const we=await Vo();u(we)}},onCancel:()=>lt(null)}),h.jsx(Qk,{isOpen:!!ll,file:ll,onConfirm:()=>{if(ll){const D=ll;Nt(null),wn(D)}},onDismiss:()=>Nt(null)})]})}class Y4 extends _.Component{constructor(){super(...arguments);Qf(this,"state",{error:null})}static getDerivedStateFromError(a){return{error:a}}componentDidCatch(a,u){console.error("Application render error:",a,u.componentStack)}render(){return this.state.error?h.jsx("main",{className:"flex min-h-screen items-center justify-center bg-app p-6 text-ink",children:h.jsxs("section",{className:"w-full max-w-lg rounded-lg border border-line bg-surface p-6",children:[h.jsx("h1",{className:"text-base font-semibold",children:"ProFiles encountered an error"}),h.jsx("p",{className:"mt-2 text-sm text-ink-secondary",children:"The interface could not continue. Reload the application to try again."}),h.jsxs("details",{className:"mt-4 text-xs text-ink-muted",children:[h.jsx("summary",{className:"cursor-pointer",children:"Error details"}),h.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap",children:this.state.error.message})]}),h.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"btn btn-primary mt-5 px-4 py-2 text-sm font-semibold",children:"Reload application"})]})}):this.props.children}}i2.createRoot(document.getElementById("root")).render(h.jsx(Jv.StrictMode,{children:h.jsx(Y4,{children:h.jsx(V4,{})})})); +http://${a==null?void 0:a.ip}:${window.location.port}`:"ProFiles will be reachable only on this machine.",confirmLabel:Le?"Enable LAN":"Restrict",onConfirm:async()=>{const z=Le;lt(null);try{await s2(z),he(z?"Updating LAN binding…":"Restricting ProFiles to this machine…","info");const C=await c2(z);C&&u(C),(C==null?void 0:C.lan_enabled)===z?he(z?"ProFiles is now reachable on the local network.":"ProFiles is restricted to this machine.","info"):he("Failed to update LAN binding — the previous address is still active.","error")}catch(C){const P=C instanceof Error?C.message:"Failed to update LAN binding";he(`Failed to update LAN binding: ${P}`,"error");const we=await Po();u(we)}},onCancel:()=>lt(null)}),h.jsx(Xk,{isOpen:!!ll,file:ll,onConfirm:()=>{if(ll){const z=ll;Nt(null),wn(z)}},onDismiss:()=>Nt(null)})]})}class G4 extends _.Component{constructor(){super(...arguments);Qf(this,"state",{error:null})}static getDerivedStateFromError(a){return{error:a}}componentDidCatch(a,u){console.error("Application render error:",a,u.componentStack)}render(){return this.state.error?h.jsx("main",{className:"flex min-h-screen items-center justify-center bg-app p-6 text-ink",children:h.jsxs("section",{className:"w-full max-w-lg rounded-lg border border-line bg-surface p-6",children:[h.jsx("h1",{className:"text-base font-semibold",children:"ProFiles encountered an error"}),h.jsx("p",{className:"mt-2 text-sm text-ink-secondary",children:"The interface could not continue. Reload the application to try again."}),h.jsxs("details",{className:"mt-4 text-xs text-ink-muted",children:[h.jsx("summary",{className:"cursor-pointer",children:"Error details"}),h.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap",children:this.state.error.message})]}),h.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"btn btn-primary mt-5 px-4 py-2 text-sm font-semibold",children:"Reload application"})]})}):this.props.children}}i2.createRoot(document.getElementById("root")).render(h.jsx(Jv.StrictMode,{children:h.jsx(G4,{children:h.jsx(Y4,{})})})); diff --git a/src/profiles/web/dist/index.html b/src/profiles/web/dist/index.html index 02f22fe..5f7bac6 100644 --- a/src/profiles/web/dist/index.html +++ b/src/profiles/web/dist/index.html @@ -5,7 +5,7 @@ ProFiles - + diff --git a/src/profiles/web/dist/sw.js b/src/profiles/web/dist/sw.js index 0e8758d..57fa4c5 100644 --- a/src/profiles/web/dist/sw.js +++ b/src/profiles/web/dist/sw.js @@ -1 +1 @@ -if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const l=e=>i(e,t),d={module:{uri:t},exports:o,require:l};s[t]=Promise.all(n.map(e=>d[e]||l(e))).then(e=>(r(...e),o))}}define(["./workbox-9c191d2f"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"72c400a126a682d81cf470895cabad52"},{url:"assets/index-DlrIRth4.css",revision:null},{url:"assets/index-C-z6GSZn.js",revision:null},{url:"manifest.webmanifest",revision:"5a42ebe8b55b07b5831cbbddda834829"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}); +if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const l=e=>i(e,t),d={module:{uri:t},exports:o,require:l};s[t]=Promise.all(n.map(e=>d[e]||l(e))).then(e=>(r(...e),o))}}define(["./workbox-9c191d2f"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"a3a08a8e4f4ddd06111646ea79a742bf"},{url:"assets/index-DlrIRth4.css",revision:null},{url:"assets/index-B7u9N9je.js",revision:null},{url:"manifest.webmanifest",revision:"5a42ebe8b55b07b5831cbbddda834829"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}); diff --git a/src/profiles/web/src/App.tsx b/src/profiles/web/src/App.tsx index 7c1f848..1f20f51 100644 --- a/src/profiles/web/src/App.tsx +++ b/src/profiles/web/src/App.tsx @@ -18,6 +18,7 @@ import { reloadConfig, exportCsvToDisk, setLanEnabled, + waitForLanState, } from "./api/client"; import type { AppConfigData, ExternalEvent, ScanSort, ScannedFileItem, SystemInfo } from "./api/types"; import { @@ -1703,14 +1704,28 @@ export default function App() { setLanPending(null); try { await setLanEnabled(next); - const sys = await fetchSystemInfo(); - setSystemInfo(sys); showToast( next - ? "ProFiles is now reachable on the local network." - : "ProFiles is restricted to this machine.", + ? "Updating LAN binding…" + : "Restricting ProFiles to this machine…", "info" ); + // The rebind runs after the response; observe the real outcome. + const sys = await waitForLanState(next); + if (sys) setSystemInfo(sys); + if (sys?.lan_enabled === next) { + showToast( + next + ? "ProFiles is now reachable on the local network." + : "ProFiles is restricted to this machine.", + "info" + ); + } else { + showToast( + "Failed to update LAN binding — the previous address is still active.", + "error" + ); + } } catch (err) { const msg = err instanceof Error ? err.message : "Failed to update LAN binding"; showToast(`Failed to update LAN binding: ${msg}`, "error"); diff --git a/src/profiles/web/src/api/client.ts b/src/profiles/web/src/api/client.ts index cda4c0a..16c3bc0 100644 --- a/src/profiles/web/src/api/client.ts +++ b/src/profiles/web/src/api/client.ts @@ -72,10 +72,14 @@ export async function fetchSystemInfo(): Promise { return res.json(); } -/** Flip the running server between LAN exposure and loopback-only. */ +/** Flip the running server between LAN exposure and loopback-only. + * + * The rebind runs after the response ships, so the returned state is the + * *requested* one — observe the actual outcome with waitForLanState(). + */ export async function setLanEnabled( lan: boolean -): Promise<{ host: string; lan_enabled: boolean }> { +): Promise<{ host: string; lan_enabled: boolean; status: string }> { const res = await fetch("/api/system/bind", { method: "POST", headers: { "Content-Type": "application/json" }, @@ -94,6 +98,30 @@ export async function setLanEnabled( return res.json(); } +/** + * Poll /api/system until the LAN state matches the request, or timeout. + * The rebind runs on the server after the bind response, so the state + * needs a moment to catch up — and the server may briefly refuse + * connections mid-restart, so failed polls are tolerated. + */ +export async function waitForLanState( + target: boolean, + timeoutMs = 10000 +): Promise { + const deadline = Date.now() + timeoutMs; + let last: SystemInfo | null = null; + while (Date.now() < deadline) { + try { + last = await fetchSystemInfo(); + if (last.lan_enabled === target) return last; + } catch { + // the server may be mid-restart; keep polling until the deadline + } + await new Promise((resolve) => setTimeout(resolve, 500)); + } + return last; +} + export async function fetchConfig(): Promise { const res = await fetch("/api/config"); if (!res.ok) throw new Error("Failed to fetch app configuration"); diff --git a/tests/desktop/test_lifecycle.py b/tests/desktop/test_lifecycle.py index 7754131..43dca4c 100644 --- a/tests/desktop/test_lifecycle.py +++ b/tests/desktop/test_lifecycle.py @@ -126,6 +126,44 @@ def test_rebind_changes_host_and_reverses(tmp_path: Path) -> None: server.stop() +def _wait_for(condition, timeout_s: float = 5.0) -> bool: + """Poll ``condition`` until truthy or ``timeout_s`` elapsed.""" + deadline = time.monotonic() + timeout_s + while time.monotonic() < deadline: + if condition(): + return True + time.sleep(0.05) + return condition() + + +def test_bind_route_rebinds_off_the_serving_thread() -> None: + """The bind route must not join the server thread it is running on. + + Regression test: the route handler runs on the uvicorn thread, so a + synchronous ``rebind()`` called ``stop()`` → ``self._thread.join()`` on + the *current* thread and died with ``RuntimeError: cannot join current + thread``. The rebind now happens after the response, on a worker thread. + """ + port = find_available_port(start_port=8000) + server = BackgroundServer(config=AppConfig(title="route rebind"), host="127.0.0.1", port=port) + server.start() + try: + response = httpx.post( + f"http://127.0.0.1:{port}/api/system/bind", + json={"lan": True}, + timeout=5.0, + ) + assert response.status_code == 200 + assert response.json()["status"] == "rebinding" + + # The rebind completes asynchronously, after the response is sent: + assert _wait_for(lambda: server.host == "0.0.0.0"), server.host + health = httpx.get(f"http://127.0.0.1:{port}/api/health", timeout=2.0) + assert health.status_code == 200 + finally: + server.stop() + + _original_socket_bind = socket.socket.bind diff --git a/tests/server/routes/test_system.py b/tests/server/routes/test_system.py index 2aed723..1db4ff6 100644 --- a/tests/server/routes/test_system.py +++ b/tests/server/routes/test_system.py @@ -2,14 +2,28 @@ from __future__ import annotations +import logging +import time + import pytest from httpx import ASGITransport, AsyncClient from profiles.core.config.models import AppConfig from profiles.server.app import create_app +from profiles.server.routes.system import _rebind_worker from profiles.server.state import ServerState +def _wait_for(condition, timeout_s: float = 5.0) -> bool: + """Poll ``condition`` until truthy or ``timeout_s`` elapsed.""" + deadline = time.monotonic() + timeout_s + while time.monotonic() < deadline: + if condition(): + return True + time.sleep(0.05) + return condition() + + @pytest.fixture def test_state() -> ServerState: config = AppConfig(title="Test Bench") @@ -77,7 +91,7 @@ async def test_bind_without_server_returns_503(test_state: ServerState) -> None: async def test_bind_runs_rebind_on_registered_server( test_state: ServerState, ) -> None: - """lan=True rebinds to 0.0.0.0 and reflects the new state.""" + """lan=True schedules the rebind and answers before it completes.""" calls: list[str] = [] class _RecordingServer(_StubServer): @@ -95,15 +109,62 @@ def rebind(self, host: str) -> None: # noqa: F811 async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client: response = await client.post("/api/system/bind", json={"lan": True}) assert response.status_code == 200 - assert response.json() == {"host": "0.0.0.0", "lan_enabled": True} - assert calls == ["0.0.0.0"] + # The rebind is asynchronous: the response ships first. + assert response.json() == { + "host": "0.0.0.0", + "lan_enabled": True, + "status": "rebinding", + } + assert _wait_for(lambda: calls == ["0.0.0.0"]), calls + + +@pytest.mark.anyio +async def test_bind_worker_logs_bind_changed_on_success( + test_state: ServerState, caplog: pytest.LogCaptureFixture +) -> None: + """The rebind worker leaves a BIND_CHANGED line on success.""" + + class _OkServer(_StubServer): + def rebind(self, host: str) -> None: # noqa: F811 + self.host = host + + stub = _OkServer() + with caplog.at_level(logging.INFO, logger="profiles"): + _rebind_worker(stub, "127.0.0.1") + + assert 'BIND_CHANGED host="127.0.0.1" lan=false' in caplog.text + + +def test_bind_worker_logs_failure_and_no_bind_changed( + caplog: pytest.LogCaptureFixture, +) -> None: + """A failed rebind logs BIND_CHANGE_FAILED; the server keeps serving.""" + from profiles.desktop.lifecycle import ServerStartError + + class _FailingServer(_StubServer): + def rebind(self, host: str) -> None: # noqa: F811 + raise ServerStartError("bind denied") + + stub = _FailingServer() + with caplog.at_level(logging.INFO, logger="profiles"): + _rebind_worker(stub, "0.0.0.0") + + assert 'BIND_CHANGE_FAILED host="0.0.0.0" error="bind denied"' in caplog.text + assert "BIND_CHANGED" not in caplog.text + assert stub.host == "127.0.0.1" @pytest.mark.anyio -async def test_bind_failure_returns_500_and_state_is_unchanged( +async def test_bind_failure_reverts_and_state_stays_unchanged( test_state: ServerState, ) -> None: - """A failed rebind reports the error; the bind state stays on the server.""" + """A failed rebind is answered optimistically; the state reverts. + + The route cannot know the rebind outcome synchronously (the old server + cannot shut down while serving this request), so it answers + ``rebinding`` and the revert — done by the lifecycle — is observable + through ``GET /api/system``. + """ from profiles.desktop.lifecycle import ServerStartError class _FailingServer(_StubServer): @@ -115,7 +176,7 @@ def rebind(self, host: str) -> None: # noqa: F811 app.state.background_server = stub async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client: response = await client.post("/api/system/bind", json={"lan": True}) - assert response.status_code == 500 - assert "bind denied" in response.json()["detail"] + assert response.status_code == 200 + assert response.json()["status"] == "rebinding" status = await client.get("/api/system") assert status.json()["lan_enabled"] is False From bdd2aa15920625870d2edf806ad9513cb5920622 Mon Sep 17 00:00:00 2001 From: "f.albany" Date: Tue, 3 Nov 2026 17:53:17 +0100 Subject: [PATCH 4/5] feat(app): default to loopback-only bind --host now defaults to 127.0.0.1: the status-bar LAN toggle makes LAN exposure a one-click opt-in, so serving the network by default is no longer justified. --host 0.0.0.0 pre-enables LAN for headless launches. BackgroundServer's own default flips too (safe at every layer), and the server-only banner advertises Network URLs only when the bind exposes them. Spec amended with a dated revision; guides + CHANGELOG updated. --- CHANGELOG.md | 8 +++++ docs/network-server-guide.en.md | 6 ++-- docs/network-server-guide.fr.md | 6 ++-- .../specs/2026-11-03-lan-serving-design.md | 34 +++++++++++------- src/profiles/app.py | 27 ++++++++------ src/profiles/desktop/lifecycle.py | 2 +- tests/test_app.py | 35 +++++++++++++++++-- tests/test_app_backend_selection.py | 2 +- tests/test_app_host.py | 9 ++--- 9 files changed, 94 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1df1648..c1470f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- **Loopback-only by default**: the web server now binds `127.0.0.1` on launch + (`--host 127.0.0.1` is the default); use `--host 0.0.0.0` to pre-enable LAN + serving, or flip it at runtime with the new **LAN** toggle in the status + bar. Console banners only advertise `Network:` URLs when the bind actually + exposes the network. + ## [0.11.0-rc.2] - 2026-11-02 ### Added diff --git a/docs/network-server-guide.en.md b/docs/network-server-guide.en.md index 26f7212..5b18249 100644 --- a/docs/network-server-guide.en.md +++ b/docs/network-server-guide.en.md @@ -48,10 +48,12 @@ New-NetFirewallRule -DisplayName "ProFiles Server" -Direction Inbound -Protocol ### Step 2: Start the server -In a terminal, run: +By default ProFiles is reachable **only on the machine it runs on** +(`127.0.0.1`). To serve the local network, pass `--host 0.0.0.0` (or use the +**LAN** toggle in the status bar of the desktop app): ```powershell -ProFiles --server-only +ProFiles --server-only --host 0.0.0.0 ``` **Expected output**: diff --git a/docs/network-server-guide.fr.md b/docs/network-server-guide.fr.md index a30b99e..e0ee847 100644 --- a/docs/network-server-guide.fr.md +++ b/docs/network-server-guide.fr.md @@ -48,10 +48,12 @@ New-NetFirewallRule -DisplayName "ProFiles Server" -Direction Inbound -Protocol ### Étape 2: Démarrer le serveur -Dans un terminal, exécutez : +Par défaut, ProFiles n'est accessible que **depuis la machine qui l'exécute** +(`127.0.0.1`). Pour servir le réseau local, ajoutez `--host 0.0.0.0` (ou +utilisez l'interrupteur **LAN** de la barre d'état de l'application) : ```powershell -ProFiles --server-only +ProFiles --server-only --host 0.0.0.0 ``` **Sortie attendue** : diff --git a/docs/superpowers/specs/2026-11-03-lan-serving-design.md b/docs/superpowers/specs/2026-11-03-lan-serving-design.md index 0fcf06a..4dbe834 100644 --- a/docs/superpowers/specs/2026-11-03-lan-serving-design.md +++ b/docs/superpowers/specs/2026-11-03-lan-serving-design.md @@ -3,28 +3,34 @@ **Date:** 2026-11-03 **Status:** Approved (conversation: design for `--host` approved, then UI toggle approved with build order "CLI first, then the pill toggle"). +**Revised 2026-11-03 (same day, after the toggle shipped):** default bind +flipped from `0.0.0.0` to `127.0.0.1` — see Decisions. ## Intent -Let any machine on the local network open `http://:8088/` right after -a normal `ProFiles` launch, while keeping a one-flag way to stay loopback-only — -and let the station operator flip that access at runtime from the web UI. +Keep a fresh ProFiles launch **loopback-only**; let the station operator expose +the machine to the local network with one click from the web UI status bar (or +pre-expose it at launch with `--host 0.0.0.0`), and flip it back just as +easily. ## Goals -- `ProFiles` (GUI, default) serves on `0.0.0.0` by default — LAN reachable. -- `--host` CLI option shared by GUI (desktop window) and `--server-only` mode. -- `--host 127.0.0.1` restores the old loopback-only behavior. +- `ProFiles` (GUI and `--server-only`) serves on `127.0.0.1` by default — + loopback-only, nothing reachable from the network until the operator opts in. +- `--host` CLI option shared by GUI (desktop window) and `--server-only` mode; + `--host 0.0.0.0` pre-enables LAN serving for headless/automation launches. - The PyWebView window always opens on a connectable URL (`127.0.0.1` when the bind host is `0.0.0.0`). -- Console shows `Local:` and `Network:` URLs on GUI launches too. +- Console shows `Local:` and `Network:` URLs only when the bind actually + exposes the network. - StatusBar identity pill gains a LAN on/off switch (transient — not persisted - across restarts) with a in-app confirmation naming the exposed URLs. + across restarts) with an in-app confirmation naming the exposed URLs. - Runtime rebind reverts the bind on failure; the app must never end up dead. ## Non-goals -- No persistence of the runtime LAN choice (restart = launch default). +- No persistence of the runtime LAN choice (restart = launch default, i.e. + loopback-only again). - No IPv6 binding and no hostname bind values (socket stays IPv4; see `lifecycle.py` `_bind_listener` constraint comment). @@ -36,9 +42,13 @@ and let the station operator flip that access at runtime from the web UI. - Toggle state comes from `GET /api/system` (`lan_enabled`), changes via `POST /api/system/bind` (`{"lan": bool}`). A confirm dialog mentions the exposed hostname/IP URLs. Failure surfaces a toast; state stays unchanged. -- UI-first caveat acknowledged: a colleague on another machine cannot toggle - LAN on a loopback-bound app (they can't open the UI) — that is why the CLI - default matters more. +- **Revision (2026-11-03):** the launch default is `127.0.0.1`, reversing the + original "serve `0.0.0.0` by default" decision. Rationale: the status-bar + toggle makes LAN exposure a one-click opt-in at runtime, so serving the LAN + by default is no longer justified — secure-by-default wins. `--host 0.0.0.0` + remains available for headless/automation launches where nobody will click + the toggle. The original caveat ("a colleague cannot toggle LAN on a + loopback-bound app") is accepted: the operator toggles at the console. ## Constraints diff --git a/src/profiles/app.py b/src/profiles/app.py index 9450a75..16e4eff 100644 --- a/src/profiles/app.py +++ b/src/profiles/app.py @@ -115,7 +115,7 @@ def __init__( server_only: bool = False, no_config_propose: bool = False, gui_backend: str = "web", - host: str = "0.0.0.0", + host: str = "127.0.0.1", ) -> None: """Initialize the application. @@ -324,12 +324,16 @@ def _run_server_only(self, port: int = _DEFAULT_PORT, host: str | None = None) - except ServerStartError as exc: self._report_server_start_failure(fallback_port, exc) - # Display both local and network URLs - local_ip = get_local_ip() - print("ProFiles server running at:") - print(f" Local: http://127.0.0.1:{server.port}") - print(f" Network: http://{local_ip}:{server.port}") - print(" Access from other PCs on your network (press Ctrl+C to stop)") + # Advertise LAN URLs only when the bind actually exposes them. + if (host or self._host) == "0.0.0.0": + local_ip = get_local_ip() + print("ProFiles server running at:") + print(f" Local: http://127.0.0.1:{server.port}") + print(f" Network: http://{local_ip}:{server.port}") + print(" Access from other PCs on your network (press Ctrl+C to stop)") + else: + print("ProFiles server running at:") + print(f" Local: http://{server.host}:{server.port}") try: while server.is_running: time.sleep(0.5) @@ -617,16 +621,17 @@ def main() -> None: profiles --headless Headless: scan & launch all profiles --headless file.mttl Headless: launch specific file profiles --init Generate default .profiles in CWD - profiles --host 127.0.0.1 Restrict serving to this machine (loopback only) + profiles --host 0.0.0.0 Serve the local network (also: LAN toggle in the status bar) """, ) parser.add_argument( "--host", - default="0.0.0.0", + default="127.0.0.1", type=str, help=( - "Bind address for the web server (default: 0.0.0.0, reachable " - "from the local network; 127.0.0.1 restricts to this machine)" + "Bind address for the web server (default: 127.0.0.1, this " + "machine only; 0.0.0.0 serves the local network — also " + "toggleable at runtime from the status bar)" ), ) parser.add_argument( diff --git a/src/profiles/desktop/lifecycle.py b/src/profiles/desktop/lifecycle.py index b393ed9..696995f 100644 --- a/src/profiles/desktop/lifecycle.py +++ b/src/profiles/desktop/lifecycle.py @@ -60,7 +60,7 @@ def find_available_port(start_port: int = 8088, max_attempts: int = 50) -> int: class BackgroundServer: """Spawns and manages a local Uvicorn instance in a background thread.""" - def __init__(self, config: AppConfig, host: str = "0.0.0.0", port: int = 8088) -> None: + def __init__(self, config: AppConfig, host: str = "127.0.0.1", port: int = 8088) -> None: self.config = config self.host = host self.port = port if port != 0 else find_available_port(8088) diff --git a/tests/test_app.py b/tests/test_app.py index 736e24b..ab7e1bf 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -445,6 +445,37 @@ def test_handoff_success_exits_without_second_server(self, mocker, tmp_path) -> assert mock_server_cls.call_count == 1 +class TestServerOnlyBanner: + """The console banner must not advertise LAN URLs on a loopback bind.""" + + def test_loopback_bind_prints_local_only(self, mocker, tmp_path, capsys) -> None: # type: ignore[no-untyped-def] + mock_server_cls = mocker.patch("profiles.desktop.lifecycle.BackgroundServer") + mock_server_cls.return_value.is_running = False + mock_server_cls.return_value.port = 8088 + mock_server_cls.return_value.host = "127.0.0.1" + app = ProFileApp(config_path=tmp_path / ".profiles", host="127.0.0.1") + app._config = mocker.MagicMock() + app._run_server_only(port=8088) + out = capsys.readouterr().out + assert "Local: http://127.0.0.1:8088" in out + assert "Network:" not in out + assert "Access from other PCs" not in out + + def test_wildcard_bind_prints_network_url(self, mocker, tmp_path, capsys) -> None: # type: ignore[no-untyped-def] + mocker.patch("profiles.utils.network.get_local_ip", return_value="192.0.2.7") + mock_server_cls = mocker.patch("profiles.desktop.lifecycle.BackgroundServer") + mock_server_cls.return_value.is_running = False + mock_server_cls.return_value.port = 8088 + mock_server_cls.return_value.host = "0.0.0.0" + app = ProFileApp(config_path=tmp_path / ".profiles", host="0.0.0.0") + app._config = mocker.MagicMock() + app._run_server_only(port=8088) + out = capsys.readouterr().out + assert "Local: http://127.0.0.1:8088" in out + assert "Network: http://192.0.2.7:8088" in out + assert "Access from other PCs" in out + + class TestStopPortOwnerCommand: """_stop_port_owner_command - the advice embedded in startup errors.""" @@ -526,7 +557,7 @@ def test_headless_flag(self, mocker) -> None: # type: ignore[no-untyped-def] server_only=False, no_config_propose=False, gui_backend="web", - host="0.0.0.0", + host="127.0.0.1", ) mock_app.return_value.run.assert_called_once_with(file=None) @@ -555,7 +586,7 @@ def test_default_no_args(self, mocker) -> None: # type: ignore[no-untyped-def] server_only=False, no_config_propose=False, gui_backend="web", - host="0.0.0.0", + host="127.0.0.1", ) diff --git a/tests/test_app_backend_selection.py b/tests/test_app_backend_selection.py index 722827a..79eb074 100644 --- a/tests/test_app_backend_selection.py +++ b/tests/test_app_backend_selection.py @@ -34,4 +34,4 @@ def test_launch_web_backend_calls_desktop() -> None: app._config = AppConfig(title="Test Bench") with patch("profiles.desktop.launcher.launch_desktop_window") as mock_launch: app._run_web_gui() - mock_launch.assert_called_once_with(app._config, port=8088, host="0.0.0.0") + mock_launch.assert_called_once_with(app._config, port=8088, host="127.0.0.1") diff --git a/tests/test_app_host.py b/tests/test_app_host.py index 4e15f94..95516b5 100644 --- a/tests/test_app_host.py +++ b/tests/test_app_host.py @@ -21,9 +21,10 @@ def test_host_error_rejects_hostname_and_ipv6() -> None: assert host_error("::1") is not None -def test_default_host_is_lan_wildcard() -> None: +def test_default_host_is_loopback() -> None: + """The app launches loopback-only; LAN is an opt-in via the status bar.""" app = ProFileApp(headless=False) - assert app._host == "0.0.0.0" + assert app._host == "127.0.0.1" def test_explicit_loopback_host_is_kept() -> None: @@ -59,10 +60,10 @@ def test_main_passes_host_argument() -> None: assert call.kwargs["host"] == "127.0.0.1" -def test_main_default_host_is_wildcard() -> None: +def test_main_default_host_is_loopback() -> None: argv = ["profiles"] with patch.object(sys, "argv", argv), patch("profiles.app.ProFileApp") as mock_app: main() call = mock_app.call_args assert call is not None - assert call.kwargs["host"] == "0.0.0.0" + assert call.kwargs["host"] == "127.0.0.1" From bcc8ed388f763a49e5f18d9112678cb858c85896 Mon Sep 17 00:00:00 2001 From: "f.albany" Date: Tue, 3 Nov 2026 17:53:20 +0100 Subject: [PATCH 5/5] feat(web): copy buttons for the LAN dialog URLs New CopyableUrl component (monospace URL + icon-only copy button with success/error callbacks); ConfirmDialog.message now accepts a ReactNode so the LAN dialog can embed the URL rows. Clipboard feedback follows the existing path/filename copy toasts. --- .../{index-B7u9N9je.js => index-DF2VzIlA.js} | 188 +++++++++--------- .../web/dist/assets/index-DlrIRth4.css | 1 - .../web/dist/assets/index-UtzA6W35.css | 1 + src/profiles/web/dist/index.html | 4 +- src/profiles/web/dist/sw.js | 2 +- src/profiles/web/src/App.tsx | 25 ++- .../web/src/components/ConfirmDialog.tsx | 9 +- .../web/src/components/CopyableUrl.test.tsx | 53 +++++ .../web/src/components/CopyableUrl.tsx | 48 +++++ src/profiles/web/tsconfig.tsbuildinfo | 2 +- 10 files changed, 227 insertions(+), 106 deletions(-) rename src/profiles/web/dist/assets/{index-B7u9N9je.js => index-DF2VzIlA.js} (84%) delete mode 100644 src/profiles/web/dist/assets/index-DlrIRth4.css create mode 100644 src/profiles/web/dist/assets/index-UtzA6W35.css create mode 100644 src/profiles/web/src/components/CopyableUrl.test.tsx create mode 100644 src/profiles/web/src/components/CopyableUrl.tsx diff --git a/src/profiles/web/dist/assets/index-B7u9N9je.js b/src/profiles/web/dist/assets/index-DF2VzIlA.js similarity index 84% rename from src/profiles/web/dist/assets/index-B7u9N9je.js rename to src/profiles/web/dist/assets/index-DF2VzIlA.js index 8b37d30..3f0292a 100644 --- a/src/profiles/web/dist/assets/index-B7u9N9je.js +++ b/src/profiles/web/dist/assets/index-DF2VzIlA.js @@ -1,4 +1,4 @@ -var Xv=Object.defineProperty;var Iv=(n,r,a)=>r in n?Xv(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a;var Qf=(n,r,a)=>Iv(n,typeof r!="symbol"?r+"":r,a);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))u(s);new MutationObserver(s=>{for(const d of s)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&u(f)}).observe(document,{childList:!0,subtree:!0});function a(s){const d={};return s.integrity&&(d.integrity=s.integrity),s.referrerPolicy&&(d.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?d.credentials="include":s.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function u(s){if(s.ep)return;s.ep=!0;const d=a(s);fetch(s.href,d)}})();function Hd(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Xf={exports:{}},$a={};/** +var Iv=Object.defineProperty;var Kv=(n,r,a)=>r in n?Iv(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a;var Qf=(n,r,a)=>Kv(n,typeof r!="symbol"?r+"":r,a);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))u(s);new MutationObserver(s=>{for(const d of s)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&u(f)}).observe(document,{childList:!0,subtree:!0});function a(s){const d={};return s.integrity&&(d.integrity=s.integrity),s.referrerPolicy&&(d.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?d.credentials="include":s.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function u(s){if(s.ep)return;s.ep=!0;const d=a(s);fetch(s.href,d)}})();function Hd(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Xf={exports:{}},$a={};/** * @license React * react-jsx-runtime.production.js * @@ -6,7 +6,7 @@ var Xv=Object.defineProperty;var Iv=(n,r,a)=>r in n?Xv(n,r,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var hx;function Kv(){if(hx)return $a;hx=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(u,s,d){var f=null;if(d!==void 0&&(f=""+d),s.key!==void 0&&(f=""+s.key),"key"in s){d={};for(var m in s)m!=="key"&&(d[m]=s[m])}else d=s;return s=d.ref,{$$typeof:n,type:u,key:f,ref:s!==void 0?s:null,props:d}}return $a.Fragment=r,$a.jsx=a,$a.jsxs=a,$a}var mx;function Zv(){return mx||(mx=1,Xf.exports=Kv()),Xf.exports}var h=Zv(),If={exports:{}},ze={};/** + */var hx;function Zv(){if(hx)return $a;hx=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(u,s,d){var f=null;if(d!==void 0&&(f=""+d),s.key!==void 0&&(f=""+s.key),"key"in s){d={};for(var m in s)m!=="key"&&(d[m]=s[m])}else d=s;return s=d.ref,{$$typeof:n,type:u,key:f,ref:s!==void 0?s:null,props:d}}return $a.Fragment=r,$a.jsx=a,$a.jsxs=a,$a}var mx;function $v(){return mx||(mx=1,Xf.exports=Zv()),Xf.exports}var h=$v(),If={exports:{}},ze={};/** * @license React * react.production.js * @@ -14,7 +14,7 @@ var Xv=Object.defineProperty;var Iv=(n,r,a)=>r in n?Xv(n,r,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var px;function $v(){if(px)return ze;px=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),w=Symbol.for("react.view_transition"),v=Symbol.iterator;function S(E){return E===null||typeof E!="object"?null:(E=v&&E[v]||E["@@iterator"],typeof E=="function"?E:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},L=Object.assign,D={};function $(E,Y,oe){this.props=E,this.context=Y,this.refs=D,this.updater=oe||T}$.prototype.isReactComponent={},$.prototype.setState=function(E,Y){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,Y,"setState")},$.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function I(){}I.prototype=$.prototype;function J(E,Y,oe){this.props=E,this.context=Y,this.refs=D,this.updater=oe||T}var ie=J.prototype=new I;ie.constructor=J,L(ie,$.prototype),ie.isPureReactComponent=!0;var U=Array.isArray;function R(){}var Q={H:null,A:null,T:null,S:null},fe=Object.prototype.hasOwnProperty;function B(E,Y,oe){var de=oe.ref;return{$$typeof:n,type:E,key:Y,ref:de!==void 0?de:null,props:oe}}function ne(E,Y){return B(E.type,Y,E.props)}function V(E){return typeof E=="object"&&E!==null&&E.$$typeof===n}function se(E){var Y={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(oe){return Y[oe]})}var ve=/\/+/g;function ae(E,Y){return typeof E=="object"&&E!==null&&E.key!=null?se(""+E.key):Y.toString(36)}function A(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(R,R):(E.status="pending",E.then(function(Y){E.status==="pending"&&(E.status="fulfilled",E.value=Y)},function(Y){E.status==="pending"&&(E.status="rejected",E.reason=Y)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function W(E,Y,oe,de,je){var ye=typeof E;(ye==="undefined"||ye==="boolean")&&(E=null);var _e=!1;if(E===null)_e=!0;else switch(ye){case"bigint":case"string":case"number":_e=!0;break;case"object":switch(E.$$typeof){case n:case r:_e=!0;break;case y:return _e=E._init,W(_e(E._payload),Y,oe,de,je)}}if(_e)return je=je(E),_e=de===""?"."+ae(E,0):de,U(je)?(oe="",_e!=null&&(oe=_e.replace(ve,"$&/")+"/"),W(je,Y,oe,"",function(Rt){return Rt})):je!=null&&(V(je)&&(je=ne(je,oe+(je.key==null||E&&E.key===je.key?"":(""+je.key).replace(ve,"$&/")+"/")+_e)),Y.push(je)),1;_e=0;var pe=de===""?".":de+":";if(U(E))for(var Se=0;Ser in n?Xv(n,r,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var xx;function Pv(){return xx||(xx=1,(function(n){function r(A,W){var le=A.length;A.push(W);e:for(;0>>1,N=A[re];if(0>>1;res(M,le))Es(Y,M)?(A[re]=Y,A[E]=le,re=E):(A[re]=M,A[Ge]=le,re=Ge);else if(Es(Y,le))A[re]=Y,A[E]=le,re=E;else break e}}return W}function s(A,W){var le=A.sortIndex-W.sortIndex;return le!==0?le:A.id-W.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var f=Date,m=f.now();n.unstable_now=function(){return f.now()-m}}var p=[],x=[],y=1,g=null,w=3,v=!1,S=!1,T=!1,L=!1,D=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function J(A){for(var W=a(x);W!==null;){if(W.callback===null)u(x);else if(W.startTime<=A)u(x),W.sortIndex=W.expirationTime,r(p,W);else break;W=a(x)}}function ie(A){if(T=!1,J(A),!S)if(a(p)!==null)S=!0,U||(U=!0,V());else{var W=a(x);W!==null&&ae(ie,W.startTime-A)}}var U=!1,R=-1,Q=5,fe=-1;function B(){return L?!0:!(n.unstable_now()-feA&&B());){var re=g.callback;if(typeof re=="function"){g.callback=null,w=g.priorityLevel;var N=re(g.expirationTime<=A);if(A=n.unstable_now(),typeof N=="function"){g.callback=N,J(A),W=!0;break t}g===a(p)&&u(p),J(A)}else u(p);g=a(p)}if(g!==null)W=!0;else{var qe=a(x);qe!==null&&ae(ie,qe.startTime-A),W=!1}}break e}finally{g=null,w=le,v=!1}W=void 0}}finally{W?V():U=!1}}}var V;if(typeof I=="function")V=function(){I(ne)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,ve=se.port2;se.port1.onmessage=ne,V=function(){ve.postMessage(null)}}else V=function(){D(ne,0)};function ae(A,W){R=D(function(){A(n.unstable_now())},W)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(A){A.callback=null},n.unstable_forceFrameRate=function(A){0>A||125re?(A.sortIndex=le,r(x,A),a(p)===null&&A===a(x)&&(T?($(R),R=-1):T=!0,ae(ie,le-re))):(A.sortIndex=N,r(p,A),S||v||(S=!0,U||(U=!0,V()))),A},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(A){var W=w;return function(){var le=w;w=W;try{return A.apply(this,arguments)}finally{w=le}}}})($f)),$f}var yx;function Wv(){return yx||(yx=1,Zf.exports=Pv()),Zf.exports}var Jf={exports:{}},Jt={};/** + */var xx;function Wv(){return xx||(xx=1,(function(n){function r(A,W){var le=A.length;A.push(W);e:for(;0>>1,N=A[re];if(0>>1;res(M,le))Es(Y,M)?(A[re]=Y,A[E]=le,re=E):(A[re]=M,A[Ge]=le,re=Ge);else if(Es(Y,le))A[re]=Y,A[E]=le,re=E;else break e}}return W}function s(A,W){var le=A.sortIndex-W.sortIndex;return le!==0?le:A.id-W.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var f=Date,m=f.now();n.unstable_now=function(){return f.now()-m}}var p=[],x=[],y=1,g=null,w=3,v=!1,S=!1,T=!1,L=!1,D=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function J(A){for(var W=a(x);W!==null;){if(W.callback===null)u(x);else if(W.startTime<=A)u(x),W.sortIndex=W.expirationTime,r(p,W);else break;W=a(x)}}function ie(A){if(T=!1,J(A),!S)if(a(p)!==null)S=!0,U||(U=!0,V());else{var W=a(x);W!==null&&ae(ie,W.startTime-A)}}var U=!1,R=-1,Q=5,fe=-1;function B(){return L?!0:!(n.unstable_now()-feA&&B());){var re=g.callback;if(typeof re=="function"){g.callback=null,w=g.priorityLevel;var N=re(g.expirationTime<=A);if(A=n.unstable_now(),typeof N=="function"){g.callback=N,J(A),W=!0;break t}g===a(p)&&u(p),J(A)}else u(p);g=a(p)}if(g!==null)W=!0;else{var qe=a(x);qe!==null&&ae(ie,qe.startTime-A),W=!1}}break e}finally{g=null,w=le,v=!1}W=void 0}}finally{W?V():U=!1}}}var V;if(typeof I=="function")V=function(){I(ne)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,ve=se.port2;se.port1.onmessage=ne,V=function(){ve.postMessage(null)}}else V=function(){D(ne,0)};function ae(A,W){R=D(function(){A(n.unstable_now())},W)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(A){A.callback=null},n.unstable_forceFrameRate=function(A){0>A||125re?(A.sortIndex=le,r(x,A),a(p)===null&&A===a(x)&&(T?($(R),R=-1):T=!0,ae(ie,le-re))):(A.sortIndex=N,r(p,A),S||v||(S=!0,U||(U=!0,V()))),A},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(A){var W=w;return function(){var le=w;w=W;try{return A.apply(this,arguments)}finally{w=le}}}})($f)),$f}var yx;function e2(){return yx||(yx=1,Zf.exports=Wv()),Zf.exports}var Jf={exports:{}},Jt={};/** * @license React * react-dom.production.js * @@ -30,7 +30,7 @@ var Xv=Object.defineProperty;var Iv=(n,r,a)=>r in n?Xv(n,r,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var bx;function e2(){if(bx)return Jt;bx=1;var n=qd();function r(y){var g="https://react.dev/errors/"+y;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Jf.exports=e2(),Jf.exports}/** + */var bx;function t2(){if(bx)return Jt;bx=1;var n=qd();function r(y){var g="https://react.dev/errors/"+y;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Jf.exports=t2(),Jf.exports}/** * @license React * react-dom-client.production.js * @@ -38,354 +38,352 @@ var Xv=Object.defineProperty;var Iv=(n,r,a)=>r in n?Xv(n,r,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var wx;function t2(){if(wx)return Ja;wx=1;var n=Wv(),r=qd(),a=Vy();function u(e){var t="https://react.dev/errors/"+e;if(1Gt||(e.current=Bt[Gt],Bt[Gt]=null,Gt--)}function Je(e,t){Gt++,Bt[Gt]=e.current,e.current=t}var en=St(null),bn=St(null),tn=St(null),Ht=St(null);function ge(e,t){switch(Je(tn,t),Je(bn,e),Je(en,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?kg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=kg(t),e=Sg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}nt(en),Je(en,e)}function Me(){nt(en),nt(bn),nt(tn)}function Le(e){var t=e.memoizedState;t!==null&&(Gr._currentValue=t.memoizedState,Je(Ht,e)),t=en.current;var l=Sg(t,e.type);t!==l&&(Je(bn,e),Je(en,l))}function lt(e){bn.current===e&&(nt(en),nt(bn)),Ht.current===e&&(nt(Ht),Gr._currentValue=Rt)}var K,ue;function ke(e){if(K===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);K=t&&t[1]||"",ue=-1Gt||(e.current=Bt[Gt],Bt[Gt]=null,Gt--)}function Je(e,t){Gt++,Bt[Gt]=e.current,e.current=t}var en=St(null),vn=St(null),tn=St(null),Ht=St(null);function ge(e,t){switch(Je(tn,t),Je(vn,e),Je(en,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?kg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=kg(t),e=Sg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}nt(en),Je(en,e)}function Me(){nt(en),nt(vn),nt(tn)}function Le(e){var t=e.memoizedState;t!==null&&(Gr._currentValue=t.memoizedState,Je(Ht,e)),t=en.current;var l=Sg(t,e.type);t!==l&&(Je(vn,e),Je(en,l))}function lt(e){vn.current===e&&(nt(en),nt(vn)),Ht.current===e&&(nt(Ht),Gr._currentValue=Rt)}var K,ue;function ke(e){if(K===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);K=t&&t[1]||"",ue=-1)":-1o||j[i]!==F[o]){var Z=` `+j[i].replace(" at new "," at ");return e.displayName&&Z.includes("")&&(Z=Z.replace("",e.displayName)),Z}while(1<=i&&0<=o);break}}}finally{Ce=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?ke(l):""}function it(e,t){switch(e.tag){case 26:case 27:case 5:return ke(e.type);case 16:return ke("Lazy");case 13:return e.child!==t&&t!==null?ke("Suspense Fallback"):ke("Suspense");case 19:return ke("SuspenseList");case 0:case 15:return ft(e.type,!1);case 11:return ft(e.type.render,!1);case 1:return ft(e.type,!0);case 31:return ke("Activity");case 30:return ke("ViewTransition");default:return""}}function Tt(e){try{var t="",l=null;do t+=it(e,l),l=e,e=e.return;while(e);return t}catch(i){return` Error generating stack: `+i.message+` -`+i.stack}}var nn=Object.prototype.hasOwnProperty,zn=n.unstable_scheduleCallback,Dn=n.unstable_cancelCallback,Mn=n.unstable_shouldYield,ll=n.unstable_requestPaint,Nt=n.unstable_now,Et=n.unstable_getCurrentPriorityLevel,Gn=n.unstable_ImmediatePriority,Qt=n.unstable_UserBlockingPriority,il=n.unstable_NormalPriority,he=n.unstable_LowPriority,fu=n.unstable_IdlePriority,xs=n.log,vn=n.unstable_setDisableYieldValue,pt=null,gt=null;function jt(e){if(typeof xs=="function"&&vn(e),gt&&typeof gt.setStrictMode=="function")try{gt.setStrictMode(pt,e)}catch{}}var Ke=Math.clz32?Math.clz32:On,ys=Math.log,du=Math.LN2;function On(e){return e>>>=0,e===0?32:31-(ys(e)/du|0)|0}var lr=256,Si=262144,ql=4194304;function wl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ir(e,t,l){var i=e.pendingLanes;if(i===0)return 0;var o=0,c=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var k=i&134217727;return k!==0?(i=k&~c,i!==0?o=wl(i):(b&=k,b!==0?o=wl(b):l||(l=k&~e,l!==0&&(o=wl(l))))):(k=i&~c,k!==0?o=wl(k):b!==0?o=wl(b):l||(l=i&~e,l!==0&&(o=wl(l)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,l=t&-t,c>=l||c===32&&(l&4194048)!==0)?t:o}function kl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ni(e,t){(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0l;l++)t.push(e);return t}function Fl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function bs(e,t,l,i,o,c){var b=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var k=e.entanglements,j=e.expirationTimes,F=e.hiddenUpdates;for(l=b&~l;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cs=!1;if(jl)try{var sa={};Object.defineProperty(sa,"passive",{get:function(){Cs=!0}}),window.addEventListener("test",sa,sa),window.removeEventListener("test",sa,sa)}catch{Cs=!1}var Xl=null,Ts=null,Nu=null;function yh(){if(Nu)return Nu;var e,t=Ts,l=t.length,i,o="value"in Xl?Xl.value:Xl.textContent,c=o.length;for(e=0;e=da),Nh=" ",Eh=!1;function jh(e,t){switch(e){case"keyup":return Y0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ch(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var dr=!1;function Q0(e,t){switch(e){case"compositionend":return Ch(t);case"keypress":return t.which!==32?null:(Eh=!0,Nh);case"textInput":return e=t.data,e===Nh&&Eh?null:e;default:return null}}function X0(e,t){if(dr)return e==="compositionend"||!Ms&&jh(e,t)?(e=yh(),Nu=Ts=Xl=null,dr=!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"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Rh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lh(e,t){var l=Rh(e);e=0;for(var i;l;){if(l.nodeType===3){if(i=e+l.textContent.length,e<=t&&i>=t)return{node:l,offset:t-e};e=i}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Rh(l)}}function Uh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Uh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Bh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ls(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=Ls(e.document)}return t}function Us(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var e1=jl&&"documentMode"in document&&11>=document.documentMode,hr=null,Bs=null,ga=null,Hs=!1;function Hh(e,t,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Hs||hr==null||hr!==Ls(i)||(i=hr,"selectionStart"in i&&Us(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),ga&&pa(ga,i)||(ga=i,i=Ao(Bs,"onSelect"),0>=b,o-=b,ol=1<<32-Ke(t)+o|l<Ae?(Mt=Ne,Ne=null):Mt=Ne.sibling;var We=H(q,Ne,G[Ae],ee);if(We===null){Ne===null&&(Ne=Mt);break}e&&Ne&&We.alternate===null&&t(q,Ne),O=c(We,O,Ae),$e===null?xe=We:$e.sibling=We,$e=We,Ne=Mt}if(Ae===G.length)return l(q,Ne),Fe&&Al(q,Ae),xe;if(Ne===null){for(;AeAe?(Mt=Ne,Ne=null):Mt=Ne.sibling;var xi=H(q,Ne,We.value,ee);if(xi===null){Ne===null&&(Ne=Mt);break}e&&Ne&&xi.alternate===null&&t(q,Ne),O=c(xi,O,Ae),$e===null?xe=xi:$e.sibling=xi,$e=xi,Ne=Mt}if(We.done)return l(q,Ne),Fe&&Al(q,Ae),xe;if(Ne===null){for(;!We.done;Ae++,We=G.next())We=te(q,We.value,ee),We!==null&&(O=c(We,O,Ae),$e===null?xe=We:$e.sibling=We,$e=We);return Fe&&Al(q,Ae),xe}for(Ne=i(Ne);!We.done;Ae++,We=G.next())We=X(Ne,q,Ae,We.value,ee),We!==null&&(e&&(Mt=We.alternate,Mt!==null&&Ne.delete(Mt.key===null?Ae:Mt.key)),O=c(We,O,Ae),$e===null?xe=We:$e.sibling=We,$e=We);return e&&Ne.forEach(function(Qv){return t(q,Qv)}),Fe&&Al(q,Ae),xe}function Be(q,O,G,ee){if(typeof G=="object"&&G!==null&&G.type===ne&&G.key===null&&G.props.ref===void 0&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case fe:e:{for(var xe=G.key;O!==null;){if(O.key===xe){if(xe=G.type,xe===ne){if(O.tag===7){l(q,O.sibling),ee=o(O,G.props.children),Pl(ee,G),ee.return=q,q=ee;break e}}else if(O.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===N&&Bi(xe)===O.type){l(q,O.sibling),ee=o(O,G.props),Pl(ee,G),ee.return=q,q=ee;break e}l(q,O);break}else t(q,O);O=O.sibling}G.type===ne?(ee=zi(G.props.children,q.mode,ee,G.key),Pl(ee,G),ee.return=q,q=ee):(ee=Ou(G.type,G.key,G.props,null,q.mode,ee),Pl(ee,G),ee.return=q,q=ee)}return b(q);case B:e:{for(xe=G.key;O!==null;){if(O.key===xe)if(O.tag===4&&O.stateNode.containerInfo===G.containerInfo&&O.stateNode.implementation===G.implementation){l(q,O.sibling),ee=o(O,G.children||[]),ee.return=q,q=ee;break e}else{l(q,O);break}else t(q,O);O=O.sibling}ee=Xs(G,q.mode,ee),ee.return=q,q=ee}return b(q);case N:return G=Bi(G),Be(q,O,G,ee)}if(_e(G))return me(q,O,G,ee);if(de(G)){if(xe=de(G),typeof xe!="function")throw Error(u(150));return G=xe.call(G),be(q,O,G,ee)}if(typeof G.then=="function")return Be(q,O,Gu(G),ee);if(G.$$typeof===ae)return Be(q,O,qu(q,G),ee);Qu(q,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,O!==null&&O.tag===6?(l(q,O.sibling),ee=o(O,G),ee.return=q,q=ee):(l(q,O),ee=Qs(G,q.mode,ee),ee.return=q,q=ee),b(q)):l(q,O)}return function(q,O,G,ee){try{ka=0;var xe=Be(q,O,G,ee);return kr=null,xe}catch(Ne){if(Ne===wr||Ne===Vu)throw Ne;var $e=dn(29,Ne,null,q.mode);return $e.lanes=ee,$e.return=q,$e}finally{}}}var qi=sm(!0),cm=sm(!1),Wl=!1;function nc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ei(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ti(e,t,l){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(tt&2)!==0){var o=i.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),i.pending=t,t=Mu(e),Ih(e,null,l),t}return Du(e,i,t,l),Mu(e)}function Sa(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,pu(e,l)}}function ic(e,t){var l=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,l===i)){var o=null,c=null;if(l=l.firstBaseUpdate,l!==null){do{var b={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};c===null?o=c=b:c=c.next=b,l=l.next}while(l!==null);c===null?o=c=t:c=c.next=t}else o=c=t;l={baseState:i.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:i.shared,callbacks:i.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var rc=!1;function Na(){if(rc){var e=vr;if(e!==null)throw e}}function Ea(e,t,l,i){rc=!1;var o=e.updateQueue;Wl=!1;var c=o.firstBaseUpdate,b=o.lastBaseUpdate,k=o.shared.pending;if(k!==null){o.shared.pending=null;var j=k,F=j.next;j.next=null,b===null?c=F:b.next=F,b=j;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,k=Z.lastBaseUpdate,k!==b&&(k===null?Z.firstBaseUpdate=F:k.next=F,Z.lastBaseUpdate=j))}if(c!==null){var te=o.baseState;b=0,Z=F=j=null,k=c;do{var H=k.lane&-536870913,X=H!==k.lane;if(X?(Ze&H)===H:(i&H)===H){H!==0&&H===Li&&(rc=!0),Z!==null&&(Z=Z.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var me=e,be=k;H=t;var Be=l;switch(be.tag){case 1:if(me=be.payload,typeof me=="function"){te=me.call(Be,te,H);break e}te=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=be.payload,H=typeof me=="function"?me.call(Be,te,H):me,H==null)break e;te=R({},te,H);break e;case 2:Wl=!0}}H=k.callback,H!==null&&(e.flags|=64,X&&(e.flags|=8192),X=o.callbacks,X===null?o.callbacks=[H]:X.push(H))}else X={lane:H,tag:k.tag,payload:k.payload,callback:k.callback,next:null},Z===null?(F=Z=X,j=te):Z=Z.next=X,b|=H;if(k=k.next,k===null){if(k=o.shared.pending,k===null)break;X=k,k=X.next,X.next=null,o.lastBaseUpdate=X,o.shared.pending=null}}while(!0);Z===null&&(j=te),o.baseState=j,o.firstBaseUpdate=F,o.lastBaseUpdate=Z,c===null&&(o.shared.lanes=0),oi|=b,e.lanes=b,e.memoizedState=te}}function fm(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function dm(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;ec?c:8;var b=pe.T,k={};k.types=b!==null?b.types:null,pe.T=k,Ec(e,!1,t,l);try{var j=o(),F=pe.S;if(F!==null&&F(k,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var Z=f1(j,i);_a(e,t,Z,Cn(e))}else _a(e,t,i,Cn(e))}catch(te){_a(e,t,{then:function(){},status:"rejected",reason:te},Cn())}finally{Se.p=c,b!==null&&k.types!==null&&(b.types=k.types),pe.T=b}}function x1(){}function Sc(e,t,l,i){if(e.tag!==5)throw Error(u(476));var o=Gm(e).queue;Ym(e,o,t,Rt,l===null?x1:function(){return Qm(e),l(i)})}function Gm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Rt,baseState:Rt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ol,lastRenderedState:Rt},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ol,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qm(e){var t=Gm(e);t.next===null&&(t=e.alternate.memoizedState),_a(e,t.next.queue,{},Cn())}function Nc(){return Xt(Gr)}function Xm(){return Ct().memoizedState}function Im(){return Ct().memoizedState}function y1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Cn();e=ei(l);var i=ti(t,e,l);i!==null&&(gn(i,t,l),Sa(i,t,l)),t={cache:Ps()},e.payload=t;return}t=t.return}}function b1(e,t,l){var i=Cn();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},to(e)?Zm(t,l):(l=Ys(e,t,l,i),l!==null&&(gn(l,e,i),$m(l,t,i)))}function Km(e,t,l){var i=Cn();_a(e,t,l,i)}function _a(e,t,l,i){var o={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(to(e))Zm(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var b=t.lastRenderedState,k=c(b,l);if(o.hasEagerState=!0,o.eagerState=k,kn(k,b))return Du(e,t,o,0),dt===null&&zu(),!1}catch{}finally{}if(l=Ys(e,t,o,i),l!==null)return gn(l,e,i),$m(l,t,i),!0}return!1}function Ec(e,t,l,i){if(i={lane:2,revertLane:gf(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},to(e)){if(t)throw Error(u(479))}else t=Ys(e,l,i,2),t!==null&&gn(t,e,2)}function to(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function Zm(e,t){Sr=Ku=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function $m(e,t,l){if((l&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,pu(e,l)}}var no={readContext:Xt,use:Ju,useCallback:wt,useContext:wt,useEffect:wt,useImperativeHandle:wt,useLayoutEffect:wt,useInsertionEffect:wt,useMemo:wt,useReducer:wt,useRef:wt,useState:wt,useDebugValue:wt,useDeferredValue:wt,useTransition:wt,useSyncExternalStore:wt,useId:wt,useHostTransitionStatus:wt,useFormState:wt,useActionState:wt,useOptimistic:wt,useMemoCache:wt,useCacheRefresh:wt,useEffectEvent:wt},Jm={readContext:Xt,use:Ju,useCallback:function(e,t){return sn().memoizedState=[e,t===void 0?null:t],e},useContext:Xt,useEffect:Om,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Wu(4194308,4,Bm.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Wu(4194308,4,e,t)},useInsertionEffect:function(e,t){Wu(4,2,e,t)},useMemo:function(e,t){var l=sn();t=t===void 0?null:t;var i=e();if(Fi){jt(!0);try{e()}finally{jt(!1)}}return l.memoizedState=[i,t],i},useReducer:function(e,t,l){var i=sn();if(l!==void 0){var o=l(t);if(Fi){jt(!0);try{l(t)}finally{jt(!1)}}}else o=t;return i.memoizedState=i.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},i.queue=e,e=e.dispatch=b1.bind(null,Ue,e),[i.memoizedState,e]},useRef:function(e){var t=sn();return e={current:e},t.memoizedState=e},useState:function(e){e=yc(e);var t=e.queue,l=Km.bind(null,Ue,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:wc,useDeferredValue:function(e,t){var l=sn();return kc(l,e,t)},useTransition:function(){var e=yc(!1);return e=Ym.bind(null,Ue,e.queue,!0,!1),sn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var i=Ue,o=sn();if(Fe){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),dt===null)throw Error(u(349));(Ze&127)!==0||ym(i,t,l)}o.memoizedState=l;var c={value:l,getSnapshot:t};return o.queue=c,Om(vm.bind(null,i,c,e),[e]),i.flags|=2048,Er(9,{destroy:void 0},bm.bind(null,i,c,l,t),null),l},useId:function(){var e=sn(),t=dt.identifierPrefix;if(Fe){var l=sl,i=ol;l=(i&~(1<<32-Ke(i)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Zu++,0<\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof i.is=="string"?b.createElement("select",{is:i.is}):b.createElement("select"),i.multiple?c.multiple=!0:i.size&&(c.size=i.size);break;default:c=typeof i.is=="string"?b.createElement(o,{is:i.is}):b.createElement(o)}}c[Lt]=t,c[ln]=i;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)c.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=c;e:switch($t(c,o,i),o){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Ll(t)}}return yt(t),t.subtreeFlags&=-33554433,Bc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Ll(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(u(166));if(e=tn.current,br(t)){if(e=t.stateNode,l=t.memoizedProps,i=null,o=Ft,o!==null)switch(o.tag){case 27:case 5:i=o.memoizedProps}e[Lt]=t,e=!!(e.nodeValue===l||i!==null&&i.suppressHydrationWarning===!0||vg(e.nodeValue,l)),e||$l(t,!0)}else e=Va(e).createTextNode(i),e[Lt]=t,t.stateNode=e}return yt(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(i=br(t),l!==null){if(e===null){if(!i)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Lt]=t}else Di(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;yt(t),e=!1}else l=Zs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Sn(t),t):(Sn(t),null);if((t.flags&128)!==0)throw Error(u(558))}return yt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=br(t),i!==null&&i.dehydrated!==null){if(e===null){if(!o)throw Error(u(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(u(317));o[Lt]=t}else Di(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;yt(t),o=!1}else o=Zs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Sn(t),t):(Sn(t),null)}return Sn(t),(t.flags&128)!==0?(t.lanes=l,t):(l=i!==null,e=e!==null&&e.memoizedState!==null,l&&(i=t.child,o=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(o=i.alternate.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==o&&(i.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),oo(t,t.updateQueue),yt(t),null);case 4:return Me(),e===null&&vf(t.stateNode.containerInfo),t.flags|=67108864,yt(t),null;case 10:return Dl(t.type),yt(t),null;case 19:if(sc(t),i=t.memoizedState,i===null)return yt(t),null;if(o=(t.flags&128)!==0,c=i.rendering,c===null)if(o)za(i,!1);else{if(kt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Iu(e),c!==null){for(t.flags|=128,za(i,!1),e=c.updateQueue,t.updateQueue=e,oo(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Kh(l,e),l=l.sibling;return ja(t,Kt.current&1|2),Fe&&Al(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Nt()>wo&&(t.flags|=128,o=!0,za(i,!1),t.lanes=4194304)}else{if(!o)if(e=Iu(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,oo(t,e),za(i,!0),i.tail===null&&i.tailMode!=="collapsed"&&i.tailMode!=="visible"&&!c.alternate&&!Fe)return yt(t),null}else 2*Nt()-i.renderingStartTime>wo&&l!==536870912&&(t.flags|=128,o=!0,za(i,!1),t.lanes=4194304);i.isBackwards?(c.sibling=t.child,t.child=c):(e=i.last,e!==null?e.sibling=c:t.child=c,i.last=c)}if(i.tail!==null){e=i.tail;e:{for(l=e;l!==null;){if(l.alternate!==null){l=!1;break e}l=l.sibling}l=!0}return i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Nt(),e.sibling=null,c=Kt.current,c=o?c&1|2:c&1,i.tailMode==="visible"||i.tailMode==="collapsed"||!l||Fe?ja(t,c):(l=c,Je(It,t),Je(Kt,l),rn===null&&(rn=t)),Fe&&Al(t,i.treeForkCount),e}return yt(t),null;case 22:case 23:return Sn(t),uc(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(l&536870912)!==0&&(t.flags&128)===0&&(yt(t),t.subtreeFlags&6&&(t.flags|=8192)):yt(t),l=t.updateQueue,l!==null&&oo(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==l&&(t.flags|=2048),e!==null&&nt(Ui),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Dl(At),yt(t),null;case 25:return null;case 30:return t.flags|=33554432,yt(t),null}throw Error(u(156,t.tag))}function j1(e,t){switch(Is(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Dl(At),Me(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return lt(t),null;case 31:if(t.memoizedState!==null){if(Sn(t),t.alternate===null)throw Error(u(340));Di()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Sn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Di()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return sc(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Me(),null;case 10:return Dl(t.type),null;case 22:case 23:return Sn(t),uc(),e!==null&&nt(Ui),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Dl(At),null;case 25:return null;default:return null}}function kp(e,t){switch(Is(t),t.tag){case 3:Dl(At),Me();break;case 26:case 27:case 5:lt(t);break;case 4:Me();break;case 31:t.memoizedState!==null&&Sn(t);break;case 13:Sn(t);break;case 19:sc(t);break;case 10:Dl(t.type);break;case 22:case 23:Sn(t),uc(),e!==null&&nt(Ui);break;case 24:Dl(At)}}function Da(e,t){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var o=i.next;l=o;do{if((l.tag&e)===e){i=void 0;var c=l.create,b=l.inst;i=c(),b.destroy=i}l=l.next}while(l!==o)}}catch(k){ot(t,t.return,k)}}function ri(e,t,l){try{var i=t.updateQueue,o=i!==null?i.lastEffect:null;if(o!==null){var c=o.next;i=c;do{if((i.tag&e)===e){var b=i.inst,k=b.destroy;if(k!==void 0){b.destroy=void 0,o=t;var j=l,F=k;try{F()}catch(Z){ot(o,j,Z)}}}i=i.next}while(i!==c)}}catch(Z){ot(t,t.return,Z)}}function Sp(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{dm(t,l)}catch(i){ot(e,e.return,i)}}}function Np(e,t,l){l.props=Vi(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(i){ot(e,t,i)}}function cl(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:var o=e.stateNode,c=Cl(e.memoizedProps,o);(o.ref===null||o.ref.name!==c)&&(o.ref=zg(c)),i=o.ref;break;case 7:if(e.stateNode===null){var b=new Tn(e);g(e.child,!1,gv,b,void 0,void 0),e.stateNode=b}i=e.stateNode;break;default:i=e.stateNode}typeof l=="function"?e.refCleanup=l(i):l.current=i}}catch(k){ot(e,t,k)}}function Zt(e,t){var l=e.ref,i=e.refCleanup;if(l!==null)if(typeof i=="function")try{i()}catch(o){ot(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(o){ot(e,t,o)}else l.current=null}function so(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var l=0;l title"))),$t(i,t,l),i[Lt]=e,_t(i),t=i;break e;case"link":if(c=Kg("link","href",o).get(t+(l.href||""))){for(b=0;bBe&&(b=Be,Be=be,be=b);var q=Lh(k,be),O=Lh(k,Be);if(q&&O&&(X.rangeCount!==1||X.anchorNode!==q.node||X.anchorOffset!==q.offset||X.focusNode!==O.node||X.focusOffset!==O.offset)){var G=te.createRange();G.setStart(q.node,q.offset),X.removeAllRanges(),be>Be?(X.addRange(G),X.extend(O.node,O.offset)):(G.setEnd(O.node,O.offset),X.addRange(G))}}}}for(te=[],X=k;X=X.parentNode;)X.nodeType===1&&te.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;kl?32:l,pe.T=null,l=af,af=null;var c=Jn,b=gl;if(vt=0,Xi=Jn=null,gl=0,(tt&6)!==0)throw Error(u(331));var k=tt;if(tt|=4,Ip(c.current),Gp(c,c.current,b,l),tt=k,Ha(0,!1),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(pt,c)}catch{}return!0}finally{Se.p=o,pe.T=i,og(e,t)}}function sg(e,t,l){t=Ln(l,t),t=Tc(e.stateNode,t,2),e=ti(e,t,2),e!==null&&(Fl(e,2),xl(e))}function ot(e,t,l){if(e.tag===3)sg(e,e,l);else for(;t!==null;){if(t.tag===3){sg(t,e,l);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(si===null||!si.has(i))){e=Ln(l,e),l=rp(2),i=ti(t,l,2),i!==null&&(ap(l,i,t,e),Fl(i,2),xl(i));break}}t=t.return}}function hf(e,t,l){var i=e.pingCache;if(i===null){i=e.pingCache=new A1;var o=new Set;i.set(t,o)}else o=i.get(t),o===void 0&&(o=new Set,i.set(t,o));o.has(l)||(nf=!0,o.add(l),e=B1.bind(null,e,t,l),t.then(e,e))}function B1(e,t,l){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,dt===e&&(Ze&l)===l&&((kt===4||kt===3&&(Ze&62914560)===Ze&&300>Nt()-vo)&&(tt&2)===0?Lr(e,0):bo|=l,zr===Ze&&(zr=0)),xl(e)}function cg(e,t){t===0&&(t=hu()),e=Ai(e,t),e!==null&&(Fl(e,t),xl(e))}function H1(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),cg(e,l)}function q1(e,t){var l=0;switch(e.tag){case 31:case 13:var i=e.stateNode,o=e.memoizedState;o!==null&&(l=o.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(u(314))}i!==null&&i.delete(t),cg(e,l)}function F1(e,t){return zn(e,t)}var Br=null,Hr=null,mf=!1,To=!1,pf=!1,fi=0;function xl(e){e!==Hr&&e.next===null&&(Hr===null?Br=Hr=e:Hr=Hr.next=e),To=!0,mf||(mf=!0,Y1())}function Ha(e,t){if(!pf&&To){pf=!0;do for(var l=!1,i=Br;i!==null;){if(e!==0){var o=i.pendingLanes;if(o===0)var c=0;else{var b=i.suspendedLanes,k=i.pingedLanes;c=(1<<31-Ke(42|e)+1)-1,c&=o&~(b&~k),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(l=!0,mg(i,c))}else c=Ze,c=ir(i,i===dt?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(c&3)===0||kl(i,c)||(l=!0,mg(i,c));i=i.next}while(l);pf=!1}}function V1(){fg()}function fg(){To=mf=!1;var e=0;fi!==0&&ev()&&(e=fi);for(var t=Nt(),l=null,i=Br;i!==null;){var o=i.next,c=dg(i,t);c===0?(i.next=null,l===null?Br=o:l.next=o,o===null&&(Hr=l)):(l=i,(e!==0||(c&3)!==0)&&(To=!0)),i=o}vt!==0&&vt!==5||Ha(e),fi!==0&&(fi=0)}function dg(e,t){for(var l=e.suspendedLanes,i=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0k)break;var Z=j.transferSize,te=j.initiatorType;Z&&wg(te)&&(j=j.responseEnd,b+=Z*(jMo){be.length=me;break}G=new Promise(av.bind(G)),be.push(G)}}}if(0"u"?null:document;function Gg(e,t,l){var i=Fr;if(i&&typeof t=="string"&&t){var o=Oe(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof l=="string"&&(o+='[crossorigin="'+l+'"]'),Yg.has(o)||(Yg.add(o),e={rel:e,crossOrigin:l,href:t},i.querySelector(o)===null&&(t=i.createElement("link"),$t(t,"link",e),_t(t),i.head.appendChild(t)))}}function Ev(e){Bl.D(e),Gg("dns-prefetch",e,null)}function jv(e,t){Bl.C(e,t),Gg("preconnect",e,t)}function Cv(e,t,l){Bl.L(e,t,l);var i=Fr;if(i&&e&&t){var o='link[rel="preload"][as="'+Oe(t)+'"]';t==="image"&&l&&l.imageSrcSet?(o+='[imagesrcset="'+Oe(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(o+='[imagesizes="'+Oe(l.imageSizes)+'"]')):o+='[href="'+Oe(e)+'"]';var c=o;switch(t){case"style":c=Vr(e);break;case"script":c=Yr(e)}if(!(Vn.has(c)||(e=R({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Vn.set(c,e),i.querySelector(o)!==null||t==="style"&&i.querySelector(Ga(c))||t==="script"&&i.querySelector(Qa(c))))){var b=i.createElement("link");$t(b,"link",e),t==="style"&&(b[rr]=!0,b.onload=b.onerror=function(){yu(b)}),_t(b),i.head.appendChild(b)}}}function Tv(e,t){Bl.m(e,t);var l=Fr;if(l&&e){var i=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Oe(i)+'"][href="'+Oe(e)+'"]',c=o;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Yr(e)}if(!Vn.has(c)&&(e=R({rel:"modulepreload",href:e},t),Vn.set(c,e),l.querySelector(o)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Qa(c)))return}i=l.createElement("link"),$t(i,"link",e),_t(i),l.head.appendChild(i)}}}function _v(e,t,l){Bl.S(e,t,l);var i=Fr;if(i&&e){var o=Gl(i).hoistableStyles,c=Vr(e);t=t||"default";var b=o.get(c);if(!b){var k={loading:0,preload:null};if(b=i.querySelector(Ga(c)))k.loading=5;else{e=R({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Vn.get(c))&&Lf(e,l);var j=b=i.createElement("link");_t(j),$t(j,"link",e),j._p=new Promise(function(F,Z){j.onload=F,j.onerror=Z}),j.addEventListener("load",function(){k.loading|=1}),j.addEventListener("error",function(){k.loading|=2}),k.loading|=4,zo(b,t,i)}b={type:"stylesheet",instance:b,count:1,state:k},o.set(c,b)}}}function Av(e,t){Bl.X(e,t);var l=Fr;if(l&&e){var i=Gl(l).hoistableScripts,o=Yr(e),c=i.get(o);c||(c=l.querySelector(Qa(o)),c||(e=R({src:e,async:!0},t),(t=Vn.get(o))&&Uf(e,t),c=l.createElement("script"),_t(c),$t(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(o,c))}}function zv(e,t){Bl.M(e,t);var l=Fr;if(l&&e){var i=Gl(l).hoistableScripts,o=Yr(e),c=i.get(o);c||(c=l.querySelector(Qa(o)),c||(e=R({src:e,async:!0,type:"module"},t),(t=Vn.get(o))&&Uf(e,t),c=l.createElement("script"),_t(c),$t(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(o,c))}}function Qg(e,t,l,i){var o=(o=tn.current)?Ya(o):null;if(!o)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(l=Vr(l.href),t=Gl(o).hoistableStyles,i=t.get(l),i||(i={type:"style",instance:null,count:0,state:null},t.set(l,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Vr(l.href);var c=Gl(o).hoistableStyles,b=c.get(e);if(b||(o=o.ownerDocument||o,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,b),(c=o.querySelector(Ga(e)))?c._p||(b.instance=c,b.state.loading=5):(c=Vn.get(e),c||(c={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Vn.set(e,c)),Dv(o,e,c,b.state))),t&&i===null)throw Error(u(528,""));return b}if(t&&i!==null)throw Error(u(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(l=Yr(l),t=Gl(o).hoistableScripts,i=t.get(l),i||(i={type:"script",instance:null,count:0,state:null},t.set(l,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Vr(e){return'href="'+Oe(e)+'"'}function Ga(e){return'link[rel="stylesheet"]['+e+"]"}function Xg(e){return R({},e,{"data-precedence":e.precedence,precedence:null})}function Dv(e,t,l,i){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[rr]!==!0){i.loading=1;return}}else t=e.createElement("link"),t[rr]=!0,t.onload=t.onerror=yu.bind(null,t),$t(t,"link",l),_t(t),e.head.appendChild(t);i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2})}function Yr(e){return'[src="'+Oe(e)+'"]'}function Qa(e){return"script[async]"+e}function Ig(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Oe(l.href)+'"]');if(i)return t.instance=i,_t(i),i;var o=R({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),_t(i),$t(i,"style",o),zo(i,l.precedence,e),t.instance=i;case"stylesheet":o=Vr(l.href);var c=e.querySelector(Ga(o));if(c)return t.state.loading|=4,t.instance=c,_t(c),c;i=Xg(l),(o=Vn.get(o))&&Lf(i,o),c=(e.ownerDocument||e).createElement("link"),_t(c);var b=c;return b._p=new Promise(function(k,j){b.onload=k,b.onerror=j}),$t(c,"link",i),t.state.loading|=4,zo(c,l.precedence,e),t.instance=c;case"script":return c=Yr(l.src),(o=e.querySelector(Qa(c)))?(t.instance=o,_t(o),o):(i=l,(o=Vn.get(c))&&(i=R({},l),Uf(i,o)),e=e.ownerDocument||e,o=e.createElement("script"),_t(o),$t(o,"link",i),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,zo(i,l.precedence,e));return t.instance}function zo(e,t,l){for(var i=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=i.length?i[i.length-1]:null,c=o,b=0;b title"):null)}function Mv(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Zg(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function $g(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Jg(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Pg(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=Jg(t),e.suspenseyImages.push(t)),e=Lv.bind(e),t.decode().then(e,e))}function Ov(e,t,l,i){if(l.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var o=Vr(i.href),c=t.querySelector(Ga(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Xa.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=c,_t(c);return}c=t.ownerDocument||t,i=Xg(i),(o=Vn.get(o))&&Lf(i,o),c=c.createElement("link"),_t(c);var b=c;b._p=new Promise(function(k,j){b.onload=k,b.onerror=j}),$t(c,"link",i),l.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Xa.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Mo=0;function Rv(e,t){return e.stylesheets&&e.count===0&&Ro(e,e.stylesheets),0Mo?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(o)}}:null}function Wg(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Ro(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Xa(){this.count--,Wg(this)}function Lv(){this.imgCount--,Wg(this)}var Oo=null;function Ro(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Oo=new Map,t.forEach(Uv,e),Oo=null,Xa.call(e))}function Uv(e,t){if(!(t.state.loading&4)){var l=Oo.get(e);if(l)var i=l.get(null);else{l=new Map,Oo.set(e,l);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Kf.exports=t2(),Kf.exports}var l2=n2();const i2=Hd(l2);class r2 extends Error{constructor(a,u){super(a);Qf(this,"status");this.name="ApiError",this.status=u}}async function Fd(n,r){let a=r;try{const u=await n.json();u!=null&&u.detail&&(a=u.detail)}catch{}return new r2(a,n.status)}async function a2(n){const r=await fetch(`/api/notifications?after=${n}`);if(!r.ok)throw new Error("Failed to fetch notifications");return r.json()}async function u2(){const n=await fetch("/api/actions/open-log",{method:"POST"});if(!n.ok)throw new Error("Failed to open log file");return n.json()}async function o2(n){const r=new URLSearchParams;r.set("limit",String(n.limit)),n!=null&&n.level&&r.set("level",n.level),n!=null&&n.search&&r.set("search",n.search);const a=await fetch(`/api/logs?${r.toString()}`);if(!a.ok)throw new Error("Failed to fetch log entries");return a.json()}async function Po(){const n=await fetch("/api/system");if(!n.ok)throw new Error("Failed to fetch system info");return n.json()}async function s2(n){const r=await fetch("/api/system/bind",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lan:n})});if(!r.ok){let a="Failed to update LAN binding";try{const u=await r.json();u!=null&&u.detail&&(a=u.detail)}catch{}throw new Error(a)}return r.json()}async function c2(n,r=1e4){const a=Date.now()+r;let u=null;for(;Date.now()setTimeout(s,500))}return u}async function Sx(){const n=await fetch("/api/config");if(!n.ok)throw new Error("Failed to fetch app configuration");return n.json()}async function Nx(n){const r=await fetch("/api/config/select-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({directory:n})});if(!r.ok)throw new Error("Failed to select directory");return r.json()}async function f2(n){const r=await fetch("/api/config/load",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config_path:n})});if(!r.ok)throw new Error("Failed to load config file");return r.json()}async function d2(n,r){const a=await fetch("/api/config/load-content",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:n,content:r})});if(!a.ok){let u=`Failed to apply dropped config (${n})`;try{const s=await a.json();s!=null&&s.detail&&(u=s.detail)}catch{}throw new Error(u)}return a.json()}async function h2(){const n=await fetch("/api/config/reload",{method:"POST"});if(!n.ok){let r="Failed to reload configuration";try{const a=await n.json();a!=null&&a.detail&&(r=a.detail)}catch{}throw new Error(r)}return n.json()}async function m2(n){const r=await fetch("/api/config/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({directory:n})});if(!r.ok)throw new Error("Failed to create config file");return r.json()}async function p2(n){const r=`/api/fs/browse?path=${encodeURIComponent(n)}&include_hidden=true`,a=await fetch(r);if(!a.ok)throw new Error("Failed to browse config files");return a.json()}async function g2(n){const r=`/api/fs/browse?path=${encodeURIComponent(n)}`,a=await fetch(r);if(!a.ok)throw new Error("Failed to browse directory");return a.json()}async function Ex(n,r){const a=await fetch("/api/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:r});if(!a.ok)throw new Error("Failed to execute scan");return a.json()}async function Pf(n){const r=new URLSearchParams;(n==null?void 0:n.offset)!=null&&r.set("offset",String(n.offset)),(n==null?void 0:n.limit)!=null&&r.set("limit",String(n.limit)),n!=null&&n.sort_by&&r.set("sort_by",n.sort_by),n!=null&&n.sort_dir&&r.set("sort_dir",n.sort_dir);const a=r.toString(),u=`/api/scan/results${a?`?${a}`:""}`,s=await fetch(u,{signal:n==null?void 0:n.signal});if(!s.ok)throw new Error("Failed to fetch scan results");return s.json()}async function x2(n){const r=await fetch("/api/actions/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error("Failed to launch file");return r.json()}async function Yy(n){const r=await fetch("/api/actions/reveal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n})});if(!r.ok)throw new Error("Failed to reveal file");return r.json()}async function yd(n){const r=await fetch("/api/actions/open-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n})});if(!r.ok)throw new Error("Failed to open folder");return r.json()}async function jx(n){const r=await fetch("/api/actions/open-terminal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n})});if(!r.ok)throw new Error("Failed to open terminal");return r.json()}async function Cx(n,r){const a=await fetch("/api/actions/hash",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n,algorithm:r})});if(!a.ok)throw new Error("Failed to compute hash");return a.json()}async function Tx(){const n=await fetch("/api/actions/open-config",{method:"POST"});if(!n.ok)throw new Error("Failed to open config file");return n.json()}async function _x(n){const r={file_path:n.file_path||n.filePath,content:n.content},a=await fetch("/api/actions/barcode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw new Error("Failed to generate barcode");return a.json()}async function y2(n){const r=await fetch("/api/actions/barcode/decode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image_base64:n.imageBase64,formats:n.formats})});if(!r.ok)throw r.status===503?new Error("Server-side barcode decoding is unavailable"):new Error(`Failed to decode frame (HTTP ${r.status})`);return r.json()}async function b2(n,r){const a=await fetch("/api/actions/metadata",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n}),signal:r});if(!a.ok)throw new Error("Failed to fetch metadata");return a.json()}async function v2(n,r){const a=await fetch("/api/actions/export-csv",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n,filename:r})});if(!a.ok)throw new Error("Failed to export CSV");return a.json()}async function w2(n,r){const a=await fetch("/api/actions/save-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image_base64:n,filename:r})});if(!a.ok)throw new Error("Failed to save image");return a.json()}async function k2(n){const r=await fetch("/api/workflow/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw await Fd(r,"Failed to start workflow session");return r.json()}async function S2(n,r){const a=await fetch(`/api/workflow/${n}/respond`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:r})});if(!a.ok)throw await Fd(a,"Failed to respond to workflow prompt");return a.json()}async function N2(n){const r=await fetch(`/api/workflow/${n}/abort`,{method:"POST"});if(!r.ok)throw await Fd(r,"Failed to abort workflow session");return r.json()}const E2=[".profiles",".profiles.yaml",".profiles.yml",".yaml",".yml"];function j2(n){const r=n.toLowerCase();return E2.some(a=>r.endsWith(a))}function C2(n){for(const r of n)if(j2(r.name))return r;return null}function Wo(){return{depth:0,overlayVisible:!1}}function Ax(n,r,a){switch(r){case"enter":return a?{depth:n.depth+1,overlayVisible:!0}:n;case"leave":{const u=Math.max(0,n.depth-1);return{depth:u,overlayVisible:n.depth>0&&u>0}}case"drop":return Wo()}}function zx(n){return n==="light"?"light":"dark"}/** +`+i.stack}}var nn=Object.prototype.hasOwnProperty,zn=n.unstable_scheduleCallback,Dn=n.unstable_cancelCallback,Mn=n.unstable_shouldYield,ll=n.unstable_requestPaint,Nt=n.unstable_now,Et=n.unstable_getCurrentPriorityLevel,Gn=n.unstable_ImmediatePriority,Qt=n.unstable_UserBlockingPriority,il=n.unstable_NormalPriority,de=n.unstable_LowPriority,fu=n.unstable_IdlePriority,xs=n.log,wn=n.unstable_setDisableYieldValue,pt=null,gt=null;function jt(e){if(typeof xs=="function"&&wn(e),gt&&typeof gt.setStrictMode=="function")try{gt.setStrictMode(pt,e)}catch{}}var Ke=Math.clz32?Math.clz32:On,ys=Math.log,du=Math.LN2;function On(e){return e>>>=0,e===0?32:31-(ys(e)/du|0)|0}var lr=256,Si=262144,ql=4194304;function wl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ir(e,t,l){var i=e.pendingLanes;if(i===0)return 0;var o=0,c=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var k=i&134217727;return k!==0?(i=k&~c,i!==0?o=wl(i):(b&=k,b!==0?o=wl(b):l||(l=k&~e,l!==0&&(o=wl(l))))):(k=i&~c,k!==0?o=wl(k):b!==0?o=wl(b):l||(l=i&~e,l!==0&&(o=wl(l)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,l=t&-t,c>=l||c===32&&(l&4194048)!==0)?t:o}function kl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ni(e,t){(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0l;l++)t.push(e);return t}function Fl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function bs(e,t,l,i,o,c){var b=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var k=e.entanglements,j=e.expirationTimes,F=e.hiddenUpdates;for(l=b&~l;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cs=!1;if(jl)try{var sa={};Object.defineProperty(sa,"passive",{get:function(){Cs=!0}}),window.addEventListener("test",sa,sa),window.removeEventListener("test",sa,sa)}catch{Cs=!1}var Xl=null,Ts=null,Nu=null;function yh(){if(Nu)return Nu;var e,t=Ts,l=t.length,i,o="value"in Xl?Xl.value:Xl.textContent,c=o.length;for(e=0;e=da),Nh=" ",Eh=!1;function jh(e,t){switch(e){case"keyup":return G0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ch(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var dr=!1;function X0(e,t){switch(e){case"compositionend":return Ch(t);case"keypress":return t.which!==32?null:(Eh=!0,Nh);case"textInput":return e=t.data,e===Nh&&Eh?null:e;default:return null}}function I0(e,t){if(dr)return e==="compositionend"||!Ms&&jh(e,t)?(e=yh(),Nu=Ts=Xl=null,dr=!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"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Rh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lh(e,t){var l=Rh(e);e=0;for(var i;l;){if(l.nodeType===3){if(i=e+l.textContent.length,e<=t&&i>=t)return{node:l,offset:t-e};e=i}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Rh(l)}}function Uh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Uh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Bh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ls(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=Ls(e.document)}return t}function Us(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var t1=jl&&"documentMode"in document&&11>=document.documentMode,hr=null,Bs=null,ga=null,Hs=!1;function Hh(e,t,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Hs||hr==null||hr!==Ls(i)||(i=hr,"selectionStart"in i&&Us(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),ga&&pa(ga,i)||(ga=i,i=Ao(Bs,"onSelect"),0>=b,o-=b,ol=1<<32-Ke(t)+o|l<Ae?(Mt=Ne,Ne=null):Mt=Ne.sibling;var We=H(q,Ne,G[Ae],ee);if(We===null){Ne===null&&(Ne=Mt);break}e&&Ne&&We.alternate===null&&t(q,Ne),O=c(We,O,Ae),$e===null?xe=We:$e.sibling=We,$e=We,Ne=Mt}if(Ae===G.length)return l(q,Ne),Fe&&Al(q,Ae),xe;if(Ne===null){for(;AeAe?(Mt=Ne,Ne=null):Mt=Ne.sibling;var xi=H(q,Ne,We.value,ee);if(xi===null){Ne===null&&(Ne=Mt);break}e&&Ne&&xi.alternate===null&&t(q,Ne),O=c(xi,O,Ae),$e===null?xe=xi:$e.sibling=xi,$e=xi,Ne=Mt}if(We.done)return l(q,Ne),Fe&&Al(q,Ae),xe;if(Ne===null){for(;!We.done;Ae++,We=G.next())We=te(q,We.value,ee),We!==null&&(O=c(We,O,Ae),$e===null?xe=We:$e.sibling=We,$e=We);return Fe&&Al(q,Ae),xe}for(Ne=i(Ne);!We.done;Ae++,We=G.next())We=X(Ne,q,Ae,We.value,ee),We!==null&&(e&&(Mt=We.alternate,Mt!==null&&Ne.delete(Mt.key===null?Ae:Mt.key)),O=c(We,O,Ae),$e===null?xe=We:$e.sibling=We,$e=We);return e&&Ne.forEach(function(Xv){return t(q,Xv)}),Fe&&Al(q,Ae),xe}function Be(q,O,G,ee){if(typeof G=="object"&&G!==null&&G.type===ne&&G.key===null&&G.props.ref===void 0&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case fe:e:{for(var xe=G.key;O!==null;){if(O.key===xe){if(xe=G.type,xe===ne){if(O.tag===7){l(q,O.sibling),ee=o(O,G.props.children),Pl(ee,G),ee.return=q,q=ee;break e}}else if(O.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===N&&Bi(xe)===O.type){l(q,O.sibling),ee=o(O,G.props),Pl(ee,G),ee.return=q,q=ee;break e}l(q,O);break}else t(q,O);O=O.sibling}G.type===ne?(ee=zi(G.props.children,q.mode,ee,G.key),Pl(ee,G),ee.return=q,q=ee):(ee=Ou(G.type,G.key,G.props,null,q.mode,ee),Pl(ee,G),ee.return=q,q=ee)}return b(q);case B:e:{for(xe=G.key;O!==null;){if(O.key===xe)if(O.tag===4&&O.stateNode.containerInfo===G.containerInfo&&O.stateNode.implementation===G.implementation){l(q,O.sibling),ee=o(O,G.children||[]),ee.return=q,q=ee;break e}else{l(q,O);break}else t(q,O);O=O.sibling}ee=Xs(G,q.mode,ee),ee.return=q,q=ee}return b(q);case N:return G=Bi(G),Be(q,O,G,ee)}if(_e(G))return me(q,O,G,ee);if(he(G)){if(xe=he(G),typeof xe!="function")throw Error(u(150));return G=xe.call(G),be(q,O,G,ee)}if(typeof G.then=="function")return Be(q,O,Gu(G),ee);if(G.$$typeof===ae)return Be(q,O,qu(q,G),ee);Qu(q,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,O!==null&&O.tag===6?(l(q,O.sibling),ee=o(O,G),ee.return=q,q=ee):(l(q,O),ee=Qs(G,q.mode,ee),ee.return=q,q=ee),b(q)):l(q,O)}return function(q,O,G,ee){try{ka=0;var xe=Be(q,O,G,ee);return kr=null,xe}catch(Ne){if(Ne===wr||Ne===Vu)throw Ne;var $e=dn(29,Ne,null,q.mode);return $e.lanes=ee,$e.return=q,$e}finally{}}}var qi=sm(!0),cm=sm(!1),Wl=!1;function nc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ei(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ti(e,t,l){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(tt&2)!==0){var o=i.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),i.pending=t,t=Mu(e),Ih(e,null,l),t}return Du(e,i,t,l),Mu(e)}function Sa(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,pu(e,l)}}function ic(e,t){var l=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,l===i)){var o=null,c=null;if(l=l.firstBaseUpdate,l!==null){do{var b={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};c===null?o=c=b:c=c.next=b,l=l.next}while(l!==null);c===null?o=c=t:c=c.next=t}else o=c=t;l={baseState:i.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:i.shared,callbacks:i.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var rc=!1;function Na(){if(rc){var e=vr;if(e!==null)throw e}}function Ea(e,t,l,i){rc=!1;var o=e.updateQueue;Wl=!1;var c=o.firstBaseUpdate,b=o.lastBaseUpdate,k=o.shared.pending;if(k!==null){o.shared.pending=null;var j=k,F=j.next;j.next=null,b===null?c=F:b.next=F,b=j;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,k=Z.lastBaseUpdate,k!==b&&(k===null?Z.firstBaseUpdate=F:k.next=F,Z.lastBaseUpdate=j))}if(c!==null){var te=o.baseState;b=0,Z=F=j=null,k=c;do{var H=k.lane&-536870913,X=H!==k.lane;if(X?(Ze&H)===H:(i&H)===H){H!==0&&H===Li&&(rc=!0),Z!==null&&(Z=Z.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var me=e,be=k;H=t;var Be=l;switch(be.tag){case 1:if(me=be.payload,typeof me=="function"){te=me.call(Be,te,H);break e}te=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=be.payload,H=typeof me=="function"?me.call(Be,te,H):me,H==null)break e;te=R({},te,H);break e;case 2:Wl=!0}}H=k.callback,H!==null&&(e.flags|=64,X&&(e.flags|=8192),X=o.callbacks,X===null?o.callbacks=[H]:X.push(H))}else X={lane:H,tag:k.tag,payload:k.payload,callback:k.callback,next:null},Z===null?(F=Z=X,j=te):Z=Z.next=X,b|=H;if(k=k.next,k===null){if(k=o.shared.pending,k===null)break;X=k,k=X.next,X.next=null,o.lastBaseUpdate=X,o.shared.pending=null}}while(!0);Z===null&&(j=te),o.baseState=j,o.firstBaseUpdate=F,o.lastBaseUpdate=Z,c===null&&(o.shared.lanes=0),oi|=b,e.lanes=b,e.memoizedState=te}}function fm(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function dm(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;ec?c:8;var b=pe.T,k={};k.types=b!==null?b.types:null,pe.T=k,Ec(e,!1,t,l);try{var j=o(),F=pe.S;if(F!==null&&F(k,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var Z=d1(j,i);_a(e,t,Z,Tn(e))}else _a(e,t,i,Tn(e))}catch(te){_a(e,t,{then:function(){},status:"rejected",reason:te},Tn())}finally{Se.p=c,b!==null&&k.types!==null&&(b.types=k.types),pe.T=b}}function y1(){}function Sc(e,t,l,i){if(e.tag!==5)throw Error(u(476));var o=Gm(e).queue;Ym(e,o,t,Rt,l===null?y1:function(){return Qm(e),l(i)})}function Gm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Rt,baseState:Rt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ol,lastRenderedState:Rt},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ol,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qm(e){var t=Gm(e);t.next===null&&(t=e.alternate.memoizedState),_a(e,t.next.queue,{},Tn())}function Nc(){return Xt(Gr)}function Xm(){return Ct().memoizedState}function Im(){return Ct().memoizedState}function b1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Tn();e=ei(l);var i=ti(t,e,l);i!==null&&(gn(i,t,l),Sa(i,t,l)),t={cache:Ps()},e.payload=t;return}t=t.return}}function v1(e,t,l){var i=Tn();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},to(e)?Zm(t,l):(l=Ys(e,t,l,i),l!==null&&(gn(l,e,i),$m(l,t,i)))}function Km(e,t,l){var i=Tn();_a(e,t,l,i)}function _a(e,t,l,i){var o={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(to(e))Zm(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var b=t.lastRenderedState,k=c(b,l);if(o.hasEagerState=!0,o.eagerState=k,Sn(k,b))return Du(e,t,o,0),dt===null&&zu(),!1}catch{}finally{}if(l=Ys(e,t,o,i),l!==null)return gn(l,e,i),$m(l,t,i),!0}return!1}function Ec(e,t,l,i){if(i={lane:2,revertLane:gf(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},to(e)){if(t)throw Error(u(479))}else t=Ys(e,l,i,2),t!==null&&gn(t,e,2)}function to(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function Zm(e,t){Sr=Ku=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function $m(e,t,l){if((l&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,pu(e,l)}}var no={readContext:Xt,use:Ju,useCallback:wt,useContext:wt,useEffect:wt,useImperativeHandle:wt,useLayoutEffect:wt,useInsertionEffect:wt,useMemo:wt,useReducer:wt,useRef:wt,useState:wt,useDebugValue:wt,useDeferredValue:wt,useTransition:wt,useSyncExternalStore:wt,useId:wt,useHostTransitionStatus:wt,useFormState:wt,useActionState:wt,useOptimistic:wt,useMemoCache:wt,useCacheRefresh:wt,useEffectEvent:wt},Jm={readContext:Xt,use:Ju,useCallback:function(e,t){return sn().memoizedState=[e,t===void 0?null:t],e},useContext:Xt,useEffect:Om,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Wu(4194308,4,Bm.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Wu(4194308,4,e,t)},useInsertionEffect:function(e,t){Wu(4,2,e,t)},useMemo:function(e,t){var l=sn();t=t===void 0?null:t;var i=e();if(Fi){jt(!0);try{e()}finally{jt(!1)}}return l.memoizedState=[i,t],i},useReducer:function(e,t,l){var i=sn();if(l!==void 0){var o=l(t);if(Fi){jt(!0);try{l(t)}finally{jt(!1)}}}else o=t;return i.memoizedState=i.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},i.queue=e,e=e.dispatch=v1.bind(null,Ue,e),[i.memoizedState,e]},useRef:function(e){var t=sn();return e={current:e},t.memoizedState=e},useState:function(e){e=yc(e);var t=e.queue,l=Km.bind(null,Ue,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:wc,useDeferredValue:function(e,t){var l=sn();return kc(l,e,t)},useTransition:function(){var e=yc(!1);return e=Ym.bind(null,Ue,e.queue,!0,!1),sn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var i=Ue,o=sn();if(Fe){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),dt===null)throw Error(u(349));(Ze&127)!==0||ym(i,t,l)}o.memoizedState=l;var c={value:l,getSnapshot:t};return o.queue=c,Om(vm.bind(null,i,c,e),[e]),i.flags|=2048,Er(9,{destroy:void 0},bm.bind(null,i,c,l,t),null),l},useId:function(){var e=sn(),t=dt.identifierPrefix;if(Fe){var l=sl,i=ol;l=(i&~(1<<32-Ke(i)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Zu++,0<\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof i.is=="string"?b.createElement("select",{is:i.is}):b.createElement("select"),i.multiple?c.multiple=!0:i.size&&(c.size=i.size);break;default:c=typeof i.is=="string"?b.createElement(o,{is:i.is}):b.createElement(o)}}c[Lt]=t,c[ln]=i;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)c.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=c;e:switch($t(c,o,i),o){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Ll(t)}}return yt(t),t.subtreeFlags&=-33554433,Bc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Ll(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(u(166));if(e=tn.current,br(t)){if(e=t.stateNode,l=t.memoizedProps,i=null,o=Ft,o!==null)switch(o.tag){case 27:case 5:i=o.memoizedProps}e[Lt]=t,e=!!(e.nodeValue===l||i!==null&&i.suppressHydrationWarning===!0||vg(e.nodeValue,l)),e||$l(t,!0)}else e=Va(e).createTextNode(i),e[Lt]=t,t.stateNode=e}return yt(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(i=br(t),l!==null){if(e===null){if(!i)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Lt]=t}else Di(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;yt(t),e=!1}else l=Zs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Nn(t),t):(Nn(t),null);if((t.flags&128)!==0)throw Error(u(558))}return yt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=br(t),i!==null&&i.dehydrated!==null){if(e===null){if(!o)throw Error(u(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(u(317));o[Lt]=t}else Di(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;yt(t),o=!1}else o=Zs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Nn(t),t):(Nn(t),null)}return Nn(t),(t.flags&128)!==0?(t.lanes=l,t):(l=i!==null,e=e!==null&&e.memoizedState!==null,l&&(i=t.child,o=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(o=i.alternate.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==o&&(i.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),oo(t,t.updateQueue),yt(t),null);case 4:return Me(),e===null&&vf(t.stateNode.containerInfo),t.flags|=67108864,yt(t),null;case 10:return Dl(t.type),yt(t),null;case 19:if(sc(t),i=t.memoizedState,i===null)return yt(t),null;if(o=(t.flags&128)!==0,c=i.rendering,c===null)if(o)za(i,!1);else{if(kt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Iu(e),c!==null){for(t.flags|=128,za(i,!1),e=c.updateQueue,t.updateQueue=e,oo(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Kh(l,e),l=l.sibling;return ja(t,Kt.current&1|2),Fe&&Al(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Nt()>wo&&(t.flags|=128,o=!0,za(i,!1),t.lanes=4194304)}else{if(!o)if(e=Iu(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,oo(t,e),za(i,!0),i.tail===null&&i.tailMode!=="collapsed"&&i.tailMode!=="visible"&&!c.alternate&&!Fe)return yt(t),null}else 2*Nt()-i.renderingStartTime>wo&&l!==536870912&&(t.flags|=128,o=!0,za(i,!1),t.lanes=4194304);i.isBackwards?(c.sibling=t.child,t.child=c):(e=i.last,e!==null?e.sibling=c:t.child=c,i.last=c)}if(i.tail!==null){e=i.tail;e:{for(l=e;l!==null;){if(l.alternate!==null){l=!1;break e}l=l.sibling}l=!0}return i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Nt(),e.sibling=null,c=Kt.current,c=o?c&1|2:c&1,i.tailMode==="visible"||i.tailMode==="collapsed"||!l||Fe?ja(t,c):(l=c,Je(It,t),Je(Kt,l),rn===null&&(rn=t)),Fe&&Al(t,i.treeForkCount),e}return yt(t),null;case 22:case 23:return Nn(t),uc(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(l&536870912)!==0&&(t.flags&128)===0&&(yt(t),t.subtreeFlags&6&&(t.flags|=8192)):yt(t),l=t.updateQueue,l!==null&&oo(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==l&&(t.flags|=2048),e!==null&&nt(Ui),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Dl(At),yt(t),null;case 25:return null;case 30:return t.flags|=33554432,yt(t),null}throw Error(u(156,t.tag))}function C1(e,t){switch(Is(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Dl(At),Me(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return lt(t),null;case 31:if(t.memoizedState!==null){if(Nn(t),t.alternate===null)throw Error(u(340));Di()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Nn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Di()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return sc(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Me(),null;case 10:return Dl(t.type),null;case 22:case 23:return Nn(t),uc(),e!==null&&nt(Ui),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Dl(At),null;case 25:return null;default:return null}}function kp(e,t){switch(Is(t),t.tag){case 3:Dl(At),Me();break;case 26:case 27:case 5:lt(t);break;case 4:Me();break;case 31:t.memoizedState!==null&&Nn(t);break;case 13:Nn(t);break;case 19:sc(t);break;case 10:Dl(t.type);break;case 22:case 23:Nn(t),uc(),e!==null&&nt(Ui);break;case 24:Dl(At)}}function Da(e,t){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var o=i.next;l=o;do{if((l.tag&e)===e){i=void 0;var c=l.create,b=l.inst;i=c(),b.destroy=i}l=l.next}while(l!==o)}}catch(k){ot(t,t.return,k)}}function ri(e,t,l){try{var i=t.updateQueue,o=i!==null?i.lastEffect:null;if(o!==null){var c=o.next;i=c;do{if((i.tag&e)===e){var b=i.inst,k=b.destroy;if(k!==void 0){b.destroy=void 0,o=t;var j=l,F=k;try{F()}catch(Z){ot(o,j,Z)}}}i=i.next}while(i!==c)}}catch(Z){ot(t,t.return,Z)}}function Sp(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{dm(t,l)}catch(i){ot(e,e.return,i)}}}function Np(e,t,l){l.props=Vi(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(i){ot(e,t,i)}}function cl(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:var o=e.stateNode,c=Cl(e.memoizedProps,o);(o.ref===null||o.ref.name!==c)&&(o.ref=zg(c)),i=o.ref;break;case 7:if(e.stateNode===null){var b=new _n(e);g(e.child,!1,xv,b,void 0,void 0),e.stateNode=b}i=e.stateNode;break;default:i=e.stateNode}typeof l=="function"?e.refCleanup=l(i):l.current=i}}catch(k){ot(e,t,k)}}function Zt(e,t){var l=e.ref,i=e.refCleanup;if(l!==null)if(typeof i=="function")try{i()}catch(o){ot(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(o){ot(e,t,o)}else l.current=null}function so(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var l=0;l title"))),$t(i,t,l),i[Lt]=e,_t(i),t=i;break e;case"link":if(c=Kg("link","href",o).get(t+(l.href||""))){for(b=0;bBe&&(b=Be,Be=be,be=b);var q=Lh(k,be),O=Lh(k,Be);if(q&&O&&(X.rangeCount!==1||X.anchorNode!==q.node||X.anchorOffset!==q.offset||X.focusNode!==O.node||X.focusOffset!==O.offset)){var G=te.createRange();G.setStart(q.node,q.offset),X.removeAllRanges(),be>Be?(X.addRange(G),X.extend(O.node,O.offset)):(G.setEnd(O.node,O.offset),X.addRange(G))}}}}for(te=[],X=k;X=X.parentNode;)X.nodeType===1&&te.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;kl?32:l,pe.T=null,l=af,af=null;var c=Jn,b=gl;if(vt=0,Xi=Jn=null,gl=0,(tt&6)!==0)throw Error(u(331));var k=tt;if(tt|=4,Ip(c.current),Gp(c,c.current,b,l),tt=k,Ha(0,!1),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(pt,c)}catch{}return!0}finally{Se.p=o,pe.T=i,og(e,t)}}function sg(e,t,l){t=Ln(l,t),t=Tc(e.stateNode,t,2),e=ti(e,t,2),e!==null&&(Fl(e,2),xl(e))}function ot(e,t,l){if(e.tag===3)sg(e,e,l);else for(;t!==null;){if(t.tag===3){sg(t,e,l);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(si===null||!si.has(i))){e=Ln(l,e),l=rp(2),i=ti(t,l,2),i!==null&&(ap(l,i,t,e),Fl(i,2),xl(i));break}}t=t.return}}function hf(e,t,l){var i=e.pingCache;if(i===null){i=e.pingCache=new z1;var o=new Set;i.set(t,o)}else o=i.get(t),o===void 0&&(o=new Set,i.set(t,o));o.has(l)||(nf=!0,o.add(l),e=H1.bind(null,e,t,l),t.then(e,e))}function H1(e,t,l){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,dt===e&&(Ze&l)===l&&((kt===4||kt===3&&(Ze&62914560)===Ze&&300>Nt()-vo)&&(tt&2)===0?Lr(e,0):bo|=l,zr===Ze&&(zr=0)),xl(e)}function cg(e,t){t===0&&(t=hu()),e=Ai(e,t),e!==null&&(Fl(e,t),xl(e))}function q1(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),cg(e,l)}function F1(e,t){var l=0;switch(e.tag){case 31:case 13:var i=e.stateNode,o=e.memoizedState;o!==null&&(l=o.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(u(314))}i!==null&&i.delete(t),cg(e,l)}function V1(e,t){return zn(e,t)}var Br=null,Hr=null,mf=!1,To=!1,pf=!1,fi=0;function xl(e){e!==Hr&&e.next===null&&(Hr===null?Br=Hr=e:Hr=Hr.next=e),To=!0,mf||(mf=!0,G1())}function Ha(e,t){if(!pf&&To){pf=!0;do for(var l=!1,i=Br;i!==null;){if(e!==0){var o=i.pendingLanes;if(o===0)var c=0;else{var b=i.suspendedLanes,k=i.pingedLanes;c=(1<<31-Ke(42|e)+1)-1,c&=o&~(b&~k),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(l=!0,mg(i,c))}else c=Ze,c=ir(i,i===dt?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(c&3)===0||kl(i,c)||(l=!0,mg(i,c));i=i.next}while(l);pf=!1}}function Y1(){fg()}function fg(){To=mf=!1;var e=0;fi!==0&&tv()&&(e=fi);for(var t=Nt(),l=null,i=Br;i!==null;){var o=i.next,c=dg(i,t);c===0?(i.next=null,l===null?Br=o:l.next=o,o===null&&(Hr=l)):(l=i,(e!==0||(c&3)!==0)&&(To=!0)),i=o}vt!==0&&vt!==5||Ha(e),fi!==0&&(fi=0)}function dg(e,t){for(var l=e.suspendedLanes,i=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0k)break;var Z=j.transferSize,te=j.initiatorType;Z&&wg(te)&&(j=j.responseEnd,b+=Z*(jMo){be.length=me;break}G=new Promise(uv.bind(G)),be.push(G)}}}if(0"u"?null:document;function Gg(e,t,l){var i=Fr;if(i&&typeof t=="string"&&t){var o=Oe(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof l=="string"&&(o+='[crossorigin="'+l+'"]'),Yg.has(o)||(Yg.add(o),e={rel:e,crossOrigin:l,href:t},i.querySelector(o)===null&&(t=i.createElement("link"),$t(t,"link",e),_t(t),i.head.appendChild(t)))}}function jv(e){Bl.D(e),Gg("dns-prefetch",e,null)}function Cv(e,t){Bl.C(e,t),Gg("preconnect",e,t)}function Tv(e,t,l){Bl.L(e,t,l);var i=Fr;if(i&&e&&t){var o='link[rel="preload"][as="'+Oe(t)+'"]';t==="image"&&l&&l.imageSrcSet?(o+='[imagesrcset="'+Oe(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(o+='[imagesizes="'+Oe(l.imageSizes)+'"]')):o+='[href="'+Oe(e)+'"]';var c=o;switch(t){case"style":c=Vr(e);break;case"script":c=Yr(e)}if(!(Vn.has(c)||(e=R({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Vn.set(c,e),i.querySelector(o)!==null||t==="style"&&i.querySelector(Ga(c))||t==="script"&&i.querySelector(Qa(c))))){var b=i.createElement("link");$t(b,"link",e),t==="style"&&(b[rr]=!0,b.onload=b.onerror=function(){yu(b)}),_t(b),i.head.appendChild(b)}}}function _v(e,t){Bl.m(e,t);var l=Fr;if(l&&e){var i=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Oe(i)+'"][href="'+Oe(e)+'"]',c=o;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Yr(e)}if(!Vn.has(c)&&(e=R({rel:"modulepreload",href:e},t),Vn.set(c,e),l.querySelector(o)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Qa(c)))return}i=l.createElement("link"),$t(i,"link",e),_t(i),l.head.appendChild(i)}}}function Av(e,t,l){Bl.S(e,t,l);var i=Fr;if(i&&e){var o=Gl(i).hoistableStyles,c=Vr(e);t=t||"default";var b=o.get(c);if(!b){var k={loading:0,preload:null};if(b=i.querySelector(Ga(c)))k.loading=5;else{e=R({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Vn.get(c))&&Lf(e,l);var j=b=i.createElement("link");_t(j),$t(j,"link",e),j._p=new Promise(function(F,Z){j.onload=F,j.onerror=Z}),j.addEventListener("load",function(){k.loading|=1}),j.addEventListener("error",function(){k.loading|=2}),k.loading|=4,zo(b,t,i)}b={type:"stylesheet",instance:b,count:1,state:k},o.set(c,b)}}}function zv(e,t){Bl.X(e,t);var l=Fr;if(l&&e){var i=Gl(l).hoistableScripts,o=Yr(e),c=i.get(o);c||(c=l.querySelector(Qa(o)),c||(e=R({src:e,async:!0},t),(t=Vn.get(o))&&Uf(e,t),c=l.createElement("script"),_t(c),$t(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(o,c))}}function Dv(e,t){Bl.M(e,t);var l=Fr;if(l&&e){var i=Gl(l).hoistableScripts,o=Yr(e),c=i.get(o);c||(c=l.querySelector(Qa(o)),c||(e=R({src:e,async:!0,type:"module"},t),(t=Vn.get(o))&&Uf(e,t),c=l.createElement("script"),_t(c),$t(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(o,c))}}function Qg(e,t,l,i){var o=(o=tn.current)?Ya(o):null;if(!o)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(l=Vr(l.href),t=Gl(o).hoistableStyles,i=t.get(l),i||(i={type:"style",instance:null,count:0,state:null},t.set(l,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Vr(l.href);var c=Gl(o).hoistableStyles,b=c.get(e);if(b||(o=o.ownerDocument||o,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,b),(c=o.querySelector(Ga(e)))?c._p||(b.instance=c,b.state.loading=5):(c=Vn.get(e),c||(c={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Vn.set(e,c)),Mv(o,e,c,b.state))),t&&i===null)throw Error(u(528,""));return b}if(t&&i!==null)throw Error(u(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(l=Yr(l),t=Gl(o).hoistableScripts,i=t.get(l),i||(i={type:"script",instance:null,count:0,state:null},t.set(l,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Vr(e){return'href="'+Oe(e)+'"'}function Ga(e){return'link[rel="stylesheet"]['+e+"]"}function Xg(e){return R({},e,{"data-precedence":e.precedence,precedence:null})}function Mv(e,t,l,i){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[rr]!==!0){i.loading=1;return}}else t=e.createElement("link"),t[rr]=!0,t.onload=t.onerror=yu.bind(null,t),$t(t,"link",l),_t(t),e.head.appendChild(t);i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2})}function Yr(e){return'[src="'+Oe(e)+'"]'}function Qa(e){return"script[async]"+e}function Ig(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Oe(l.href)+'"]');if(i)return t.instance=i,_t(i),i;var o=R({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),_t(i),$t(i,"style",o),zo(i,l.precedence,e),t.instance=i;case"stylesheet":o=Vr(l.href);var c=e.querySelector(Ga(o));if(c)return t.state.loading|=4,t.instance=c,_t(c),c;i=Xg(l),(o=Vn.get(o))&&Lf(i,o),c=(e.ownerDocument||e).createElement("link"),_t(c);var b=c;return b._p=new Promise(function(k,j){b.onload=k,b.onerror=j}),$t(c,"link",i),t.state.loading|=4,zo(c,l.precedence,e),t.instance=c;case"script":return c=Yr(l.src),(o=e.querySelector(Qa(c)))?(t.instance=o,_t(o),o):(i=l,(o=Vn.get(c))&&(i=R({},l),Uf(i,o)),e=e.ownerDocument||e,o=e.createElement("script"),_t(o),$t(o,"link",i),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,zo(i,l.precedence,e));return t.instance}function zo(e,t,l){for(var i=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=i.length?i[i.length-1]:null,c=o,b=0;b title"):null)}function Ov(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Zg(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function $g(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Jg(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Pg(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=Jg(t),e.suspenseyImages.push(t)),e=Uv.bind(e),t.decode().then(e,e))}function Rv(e,t,l,i){if(l.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var o=Vr(i.href),c=t.querySelector(Ga(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Xa.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=c,_t(c);return}c=t.ownerDocument||t,i=Xg(i),(o=Vn.get(o))&&Lf(i,o),c=c.createElement("link"),_t(c);var b=c;b._p=new Promise(function(k,j){b.onload=k,b.onerror=j}),$t(c,"link",i),l.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Xa.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Mo=0;function Lv(e,t){return e.stylesheets&&e.count===0&&Ro(e,e.stylesheets),0Mo?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(o)}}:null}function Wg(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Ro(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Xa(){this.count--,Wg(this)}function Uv(){this.imgCount--,Wg(this)}var Oo=null;function Ro(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Oo=new Map,t.forEach(Bv,e),Oo=null,Xa.call(e))}function Bv(e,t){if(!(t.state.loading&4)){var l=Oo.get(e);if(l)var i=l.get(null);else{l=new Map,Oo.set(e,l);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Kf.exports=n2(),Kf.exports}var i2=l2();const r2=Hd(i2);class a2 extends Error{constructor(a,u){super(a);Qf(this,"status");this.name="ApiError",this.status=u}}async function Fd(n,r){let a=r;try{const u=await n.json();u!=null&&u.detail&&(a=u.detail)}catch{}return new a2(a,n.status)}async function u2(n){const r=await fetch(`/api/notifications?after=${n}`);if(!r.ok)throw new Error("Failed to fetch notifications");return r.json()}async function o2(){const n=await fetch("/api/actions/open-log",{method:"POST"});if(!n.ok)throw new Error("Failed to open log file");return n.json()}async function s2(n){const r=new URLSearchParams;r.set("limit",String(n.limit)),n!=null&&n.level&&r.set("level",n.level),n!=null&&n.search&&r.set("search",n.search);const a=await fetch(`/api/logs?${r.toString()}`);if(!a.ok)throw new Error("Failed to fetch log entries");return a.json()}async function Po(){const n=await fetch("/api/system");if(!n.ok)throw new Error("Failed to fetch system info");return n.json()}async function c2(n){const r=await fetch("/api/system/bind",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lan:n})});if(!r.ok){let a="Failed to update LAN binding";try{const u=await r.json();u!=null&&u.detail&&(a=u.detail)}catch{}throw new Error(a)}return r.json()}async function f2(n,r=1e4){const a=Date.now()+r;let u=null;for(;Date.now()setTimeout(s,500))}return u}async function Sx(){const n=await fetch("/api/config");if(!n.ok)throw new Error("Failed to fetch app configuration");return n.json()}async function Nx(n){const r=await fetch("/api/config/select-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({directory:n})});if(!r.ok)throw new Error("Failed to select directory");return r.json()}async function d2(n){const r=await fetch("/api/config/load",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config_path:n})});if(!r.ok)throw new Error("Failed to load config file");return r.json()}async function h2(n,r){const a=await fetch("/api/config/load-content",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:n,content:r})});if(!a.ok){let u=`Failed to apply dropped config (${n})`;try{const s=await a.json();s!=null&&s.detail&&(u=s.detail)}catch{}throw new Error(u)}return a.json()}async function m2(){const n=await fetch("/api/config/reload",{method:"POST"});if(!n.ok){let r="Failed to reload configuration";try{const a=await n.json();a!=null&&a.detail&&(r=a.detail)}catch{}throw new Error(r)}return n.json()}async function p2(n){const r=await fetch("/api/config/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({directory:n})});if(!r.ok)throw new Error("Failed to create config file");return r.json()}async function g2(n){const r=`/api/fs/browse?path=${encodeURIComponent(n)}&include_hidden=true`,a=await fetch(r);if(!a.ok)throw new Error("Failed to browse config files");return a.json()}async function x2(n){const r=`/api/fs/browse?path=${encodeURIComponent(n)}`,a=await fetch(r);if(!a.ok)throw new Error("Failed to browse directory");return a.json()}async function Ex(n,r){const a=await fetch("/api/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:r});if(!a.ok)throw new Error("Failed to execute scan");return a.json()}async function Pf(n){const r=new URLSearchParams;(n==null?void 0:n.offset)!=null&&r.set("offset",String(n.offset)),(n==null?void 0:n.limit)!=null&&r.set("limit",String(n.limit)),n!=null&&n.sort_by&&r.set("sort_by",n.sort_by),n!=null&&n.sort_dir&&r.set("sort_dir",n.sort_dir);const a=r.toString(),u=`/api/scan/results${a?`?${a}`:""}`,s=await fetch(u,{signal:n==null?void 0:n.signal});if(!s.ok)throw new Error("Failed to fetch scan results");return s.json()}async function y2(n){const r=await fetch("/api/actions/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error("Failed to launch file");return r.json()}async function Gy(n){const r=await fetch("/api/actions/reveal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n})});if(!r.ok)throw new Error("Failed to reveal file");return r.json()}async function yd(n){const r=await fetch("/api/actions/open-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n})});if(!r.ok)throw new Error("Failed to open folder");return r.json()}async function jx(n){const r=await fetch("/api/actions/open-terminal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n})});if(!r.ok)throw new Error("Failed to open terminal");return r.json()}async function Cx(n,r){const a=await fetch("/api/actions/hash",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n,algorithm:r})});if(!a.ok)throw new Error("Failed to compute hash");return a.json()}async function Tx(){const n=await fetch("/api/actions/open-config",{method:"POST"});if(!n.ok)throw new Error("Failed to open config file");return n.json()}async function _x(n){const r={file_path:n.file_path||n.filePath,content:n.content},a=await fetch("/api/actions/barcode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw new Error("Failed to generate barcode");return a.json()}async function b2(n){const r=await fetch("/api/actions/barcode/decode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image_base64:n.imageBase64,formats:n.formats})});if(!r.ok)throw r.status===503?new Error("Server-side barcode decoding is unavailable"):new Error(`Failed to decode frame (HTTP ${r.status})`);return r.json()}async function v2(n,r){const a=await fetch("/api/actions/metadata",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n}),signal:r});if(!a.ok)throw new Error("Failed to fetch metadata");return a.json()}async function w2(n,r){const a=await fetch("/api/actions/export-csv",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n,filename:r})});if(!a.ok)throw new Error("Failed to export CSV");return a.json()}async function k2(n,r){const a=await fetch("/api/actions/save-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image_base64:n,filename:r})});if(!a.ok)throw new Error("Failed to save image");return a.json()}async function S2(n){const r=await fetch("/api/workflow/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw await Fd(r,"Failed to start workflow session");return r.json()}async function N2(n,r){const a=await fetch(`/api/workflow/${n}/respond`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:r})});if(!a.ok)throw await Fd(a,"Failed to respond to workflow prompt");return a.json()}async function E2(n){const r=await fetch(`/api/workflow/${n}/abort`,{method:"POST"});if(!r.ok)throw await Fd(r,"Failed to abort workflow session");return r.json()}const j2=[".profiles",".profiles.yaml",".profiles.yml",".yaml",".yml"];function C2(n){const r=n.toLowerCase();return j2.some(a=>r.endsWith(a))}function T2(n){for(const r of n)if(C2(r.name))return r;return null}function Wo(){return{depth:0,overlayVisible:!1}}function Ax(n,r,a){switch(r){case"enter":return a?{depth:n.depth+1,overlayVisible:!0}:n;case"leave":{const u=Math.max(0,n.depth-1);return{depth:u,overlayVisible:n.depth>0&&u>0}}case"drop":return Wo()}}function zx(n){return n==="light"?"light":"dark"}/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const T2=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gy=(...n)=>n.filter((r,a,u)=>!!r&&r.trim()!==""&&u.indexOf(r)===a).join(" ").trim();/** + */const _2=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Qy=(...n)=>n.filter((r,a,u)=>!!r&&r.trim()!==""&&u.indexOf(r)===a).join(" ").trim();/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var _2={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"};/** + */var A2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const A2=_.forwardRef(({color:n="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:u,className:s="",children:d,iconNode:f,...m},p)=>_.createElement("svg",{ref:p,..._2,width:r,height:r,stroke:n,strokeWidth:u?Number(a)*24/Number(r):a,className:Gy("lucide",s),...m},[...f.map(([x,y])=>_.createElement(x,y)),...Array.isArray(d)?d:[d]]));/** + */const z2=_.forwardRef(({color:n="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:u,className:s="",children:d,iconNode:f,...m},p)=>_.createElement("svg",{ref:p,...A2,width:r,height:r,stroke:n,strokeWidth:u?Number(a)*24/Number(r):a,className:Qy("lucide",s),...m},[...f.map(([x,y])=>_.createElement(x,y)),...Array.isArray(d)?d:[d]]));/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ee=(n,r)=>{const a=_.forwardRef(({className:u,...s},d)=>_.createElement(A2,{ref:d,iconNode:r,className:Gy(`lucide-${T2(n)}`,u),...s}));return a.displayName=`${n}`,a};/** + */const Ee=(n,r)=>{const a=_.forwardRef(({className:u,...s},d)=>_.createElement(z2,{ref:d,iconNode:r,className:Qy(`lucide-${_2(n)}`,u),...s}));return a.displayName=`${n}`,a};/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const z2=[["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"}]],D2=Ee("Activity",z2);/** + */const D2=[["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"}]],M2=Ee("Activity",D2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const M2=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Qy=Ee("ArrowDown",M2);/** + */const O2=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Xy=Ee("ArrowDown",O2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const O2=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],R2=Ee("ArrowLeftRight",O2);/** + */const R2=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],L2=Ee("ArrowLeftRight",R2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const L2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],U2=Ee("ArrowRight",L2);/** + */const U2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],B2=Ee("ArrowRight",U2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const B2=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],Dx=Ee("ArrowUpDown",B2);/** + */const H2=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],Dx=Ee("ArrowUpDown",H2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const H2=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],q2=Ee("ArrowUp",H2);/** + */const q2=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],F2=Ee("ArrowUp",q2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const F2=[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]],V2=Ee("Bug",F2);/** + */const V2=[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]],Y2=Ee("Bug",V2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Y2=[["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"}]],G2=Ee("Calendar",Y2);/** + */const G2=[["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"}]],Q2=Ee("Calendar",G2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Q2=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],Xy=Ee("Camera",Q2);/** + */const X2=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],Iy=Ee("Camera",X2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const X2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vi=Ee("Check",X2);/** + */const I2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vi=Ee("Check",I2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const I2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],K2=Ee("ChevronDown",I2);/** + */const K2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Z2=Ee("ChevronDown",K2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Z2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Vd=Ee("ChevronRight",Z2);/** + */const $2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Vd=Ee("ChevronRight",$2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],lu=Ee("CircleAlert",$2);/** + */const J2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],lu=Ee("CircleAlert",J2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const J2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Mx=Ee("CircleCheck",J2);/** + */const P2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Mx=Ee("CircleCheck",P2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const P2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],W2=Ee("CirclePause",P2);/** + */const W2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],ew=Ee("CirclePause",W2);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ew=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]],tw=Ee("CirclePlay",ew);/** + */const tw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]],nw=Ee("CirclePlay",tw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],bd=Ee("CircleX",nw);/** + */const lw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],bd=Ee("CircleX",lw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],iw=Ee("Clock",lw);/** + */const iw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],rw=Ee("Clock",iw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const rw=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],An=Ee("Copy",rw);/** + */const aw=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],yn=Ee("Copy",aw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aw=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Iy=Ee("Download",aw);/** + */const uw=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Ky=Ee("Download",uw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const uw=[["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"}]],ow=Ee("ExternalLink",uw);/** + */const ow=[["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"}]],sw=Ee("ExternalLink",ow);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const sw=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],cw=Ee("EyeOff",sw);/** + */const cw=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],fw=Ee("EyeOff",cw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fw=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],vd=Ee("Eye",fw);/** + */const dw=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],vd=Ee("Eye",dw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dw=[["polygon",{points:"13 19 22 12 13 5 13 19",key:"587y9g"}],["polygon",{points:"2 19 11 12 2 5 2 19",key:"3pweh0"}]],hw=Ee("FastForward",dw);/** + */const hw=[["polygon",{points:"13 19 22 12 13 5 13 19",key:"587y9g"}],["polygon",{points:"2 19 11 12 2 5 2 19",key:"3pweh0"}]],mw=Ee("FastForward",hw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mw=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],wd=Ee("FileCode",mw);/** + */const pw=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],wd=Ee("FileCode",pw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pw=[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m3.2 12.9-.9-.4",key:"1i3dj5"}],["path",{d:"m3.2 15.1-.9.4",key:"1fvgj0"}],["path",{d:"M4.677 21.5a2 2 0 0 0 1.313.5H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2.5",key:"1yo3oz"}],["path",{d:"m4.9 11.2-.4-.9",key:"otmhb9"}],["path",{d:"m4.9 16.8-.4.9",key:"1b8z07"}],["path",{d:"m7.5 10.3-.4.9",key:"11k65u"}],["path",{d:"m7.5 17.7-.4-.9",key:"431x55"}],["path",{d:"m9.7 12.5-.9.4",key:"87sjan"}],["path",{d:"m9.7 15.5-.9-.4",key:"khqm91"}],["circle",{cx:"6",cy:"14",r:"3",key:"a1xfv6"}]],Kr=Ee("FileCog",pw);/** + */const gw=[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m3.2 12.9-.9-.4",key:"1i3dj5"}],["path",{d:"m3.2 15.1-.9.4",key:"1fvgj0"}],["path",{d:"M4.677 21.5a2 2 0 0 0 1.313.5H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2.5",key:"1yo3oz"}],["path",{d:"m4.9 11.2-.4-.9",key:"otmhb9"}],["path",{d:"m4.9 16.8-.4.9",key:"1b8z07"}],["path",{d:"m7.5 10.3-.4.9",key:"11k65u"}],["path",{d:"m7.5 17.7-.4-.9",key:"431x55"}],["path",{d:"m9.7 12.5-.9.4",key:"87sjan"}],["path",{d:"m9.7 15.5-.9-.4",key:"khqm91"}],["circle",{cx:"6",cy:"14",r:"3",key:"a1xfv6"}]],Kr=Ee("FileCog",gw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gw=[["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"}]],Pr=Ee("FileText",gw);/** + */const xw=[["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"}]],Pr=Ee("FileText",xw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xw=[["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"}]],Wf=Ee("File",xw);/** + */const yw=[["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"}]],Wf=Ee("File",yw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yw=[["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"}]],Ji=Ee("FolderOpen",yw);/** + */const bw=[["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"}]],Ji=Ee("FolderOpen",bw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bw=[["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"}]],ss=Ee("Folder",bw);/** + */const vw=[["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"}]],ss=Ee("Folder",vw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],ww=Ee("Globe",vw);/** + */const ww=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],kw=Ee("Globe",ww);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kw=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Zr=Ee("Hash",kw);/** + */const Sw=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Zr=Ee("Hash",Sw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Sw=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],Yd=Ee("House",Sw);/** + */const Nw=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],Yd=Ee("House",Nw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Nw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ky=Ee("Info",Nw);/** + */const Ew=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Zy=Ee("Info",Ew);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ew=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],Zy=Ee("Keyboard",Ew);/** + */const jw=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],$y=Ee("Keyboard",jw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jw=[["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"}]],Cw=Ee("Link2",jw);/** + */const Cw=[["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"}]],Tw=Ee("Link2",Cw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Tw=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Wi=Ee("LoaderCircle",Tw);/** + */const _w=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Wi=Ee("LoaderCircle",_w);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _w=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Aw=Ee("Lock",_w);/** + */const Aw=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],zw=Ee("Lock",Aw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zw=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Dw=Ee("Moon",zw);/** + */const Dw=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Mw=Ee("Moon",Dw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Mw=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],Ow=Ee("Network",Mw);/** + */const Ow=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],Rw=Ee("Network",Ow);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Rw=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],er=Ee("Play",Rw);/** + */const Lw=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],er=Ee("Play",Lw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Lw=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Uw=Ee("Plus",Lw);/** + */const Uw=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Bw=Ee("Plus",Uw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Bw=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],Gd=Ee("QrCode",Bw);/** + */const Hw=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],Gd=Ee("QrCode",Hw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Hw=[["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"}]],cs=Ee("RefreshCw",Hw);/** + */const qw=[["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"}]],cs=Ee("RefreshCw",qw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qw=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],Fw=Ee("Rocket",qw);/** + */const Fw=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],Vw=Ee("Rocket",Fw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Vw=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],$y=Ee("Search",Vw);/** + */const Yw=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Jy=Ee("Search",Yw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Yw=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Gw=Ee("Settings",Yw);/** + */const Gw=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Qw=Ee("Settings",Gw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Qw=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Xw=Ee("Sun",Qw);/** + */const Xw=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Iw=Ee("Sun",Xw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Iw=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],kd=Ee("Terminal",Iw);/** + */const Kw=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],kd=Ee("Terminal",Kw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Kw=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],Jy=Ee("Timer",Kw);/** + */const Zw=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],Py=Ee("Timer",Zw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Zw=[["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"}]],Py=Ee("Trash2",Zw);/** + */const $w=[["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"}]],Wy=Ee("Trash2",$w);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $w=[["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"}]],Wy=Ee("TriangleAlert",$w);/** + */const Jw=[["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"}]],eb=Ee("TriangleAlert",Jw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Jw=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Pw=Ee("User",Jw);/** + */const Pw=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Ww=Ee("User",Pw);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ww=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],eb=Ee("Webhook",Ww);/** + */const ek=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],tb=Ee("Webhook",ek);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ek=[["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"}]],tk=Ee("Workflow",ek);/** + */const tk=[["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"}]],nk=Ee("Workflow",tk);/** * @license lucide-react v0.477.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nk=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],nl=Ee("X",nk);function lk(n){if(n<60)return`${n}s`;const r=Math.floor(n/60),a=n%60;return`${r}m${a.toString().padStart(2,"0")}s`}function ik(n){if(!n)return{label:"",cut:!1};const r=n.replace(/\\/g,"/").split("/").filter(Boolean);return r.length===0?{label:n,cut:!1}:{label:r[r.length-1],cut:r.length>1}}function rk({directory:n}){const[r,a]=_.useState(0);_.useEffect(()=>{a(0);const d=window.setInterval(()=>{a(f=>f+1)},1e3);return()=>window.clearInterval(d)},[]);const{label:u,cut:s}=ik(n);return h.jsxs("div",{"data-testid":"scan-status-strip",className:"flex min-w-0 items-center gap-1.5 text-[11px] text-ink-muted",children:[h.jsx(Wi,{className:"h-3 w-3 shrink-0 animate-spin text-chip-indigo-text motion-reduce:animate-none","aria-hidden":"true"}),h.jsxs("span",{className:"min-w-0 truncate",children:["Scanning",n&&h.jsxs(h.Fragment,{children:[" ",h.jsxs("span",{className:"font-mono text-ink-secondary",title:n,children:[s?"…/":"",u]})]})," — ",h.jsx("span",{className:"font-mono tabular-nums text-ink-secondary",children:lk(r)})]})]})}function ak({onExecute:n,scanning:r,hasSelection:a,fileCount:u,totalCount:s,scanningDirectory:d="",toastMessage:f,onToastDismiss:m}){const p=(f==null?void 0:f.kind)==="error";return h.jsxs("div",{className:"relative flex items-center justify-between border-t border-line bg-surface-glass px-4 py-2.5 text-xs transition-colors duration-200",children:[f&&h.jsx("div",{role:"status","aria-live":p?"assertive":"polite","aria-atomic":"true",className:`animate-toast-in absolute left-1/2 top-1/2 z-[var(--z-toast)] max-w-[min(80vw,640px)] -translate-x-1/2 -translate-y-1/2 rounded-xl border px-4 py-2 text-xs font-medium glass-panel-strong ${p?"pointer-events-auto flex max-w-[min(70vw,560px)] items-center gap-2.5 border-status-danger-border text-left text-ink":"pointer-events-none max-w-[min(70vw,560px)] text-center text-ink"}`,children:p?h.jsxs(h.Fragment,{children:[h.jsx(bd,{className:"h-3.5 w-3.5 shrink-0 text-status-danger-text/80","aria-hidden":"true"}),h.jsx("span",{className:"min-w-0 flex-1",children:f.message}),m&&h.jsx("button",{type:"button",onClick:m,"aria-label":"Dismiss error",className:"shrink-0 rounded-md p-0.5 text-status-danger-text/60 hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-status-danger-border transition-colors",children:h.jsx(nl,{className:"h-3.5 w-3.5"})})]}):f.message}),h.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[r&&h.jsx(rk,{directory:d}),s!==void 0&&s!==u&&h.jsxs("span",{"data-testid":"action-bar-count",className:"text-ink-muted",children:["Showing ",u," of ",s]})]}),h.jsxs("button",{onClick:n,disabled:!a||r,className:"flex shrink-0 items-center gap-2 rounded-xl border border-emerald-300/50 bg-gradient-to-b from-emerald-400/90 to-emerald-600/90 px-5 py-2 font-semibold text-white shadow-[inset_0_1px_0_rgb(255_255_255/0.35),0_8px_24px_-6px_rgb(16_185_129/0.55)] transition-[filter,box-shadow,transform] hover:-translate-y-px hover:brightness-110 hover:shadow-[inset_0_1px_0_rgb(255_255_255/0.35),0_12px_30px_-6px_rgb(16_185_129/0.7)] disabled:opacity-40 disabled:hover:translate-y-0 disabled:hover:brightness-100 disabled:hover:shadow-[inset_0_1px_0_rgb(255_255_255/0.35),0_8px_24px_-6px_rgb(16_185_129/0.55)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400",children:[h.jsx(er,{className:"h-3.5 w-3.5 fill-current"}),h.jsx("span",{children:"Execute"}),h.jsx("kbd",{className:"rounded bg-emerald-800/60 px-1.5 py-0.5 text-[10px] text-emerald-200 shadow-[inset_0_1px_0_rgb(255_255_255/0.12)]",children:"↵"})]})]})}function uk({position:n,onClose:r,onLaunch:a,onLaunchWithArgs:u,onReveal:s,onOpenFolder:d,onOpenTerminal:f,onScanDirectory:m,onFilterFolder:p,onFilterExtension:x,onCopyPath:y,onCopyFilename:g,onCopyUri:w,onComputeHash:v,onVerifyHash:S,onProperties:T,onClearFile:L,onGenerateBarcode:D,showToast:$}){const[I,J]=_.useState(!1),[ie,U]=_.useState(""),R=_.useRef(null),Q=_.useRef(null),fe=_.useRef(null),[B,ne]=_.useState(null);if(_.useEffect(()=>{var re;I&&((re=Q.current)==null||re.showModal())},[I]),_.useLayoutEffect(()=>{if(!n){ne(null);return}const re=()=>{const N=R.current;if(!N)return;const qe=N.getBoundingClientRect(),Ge=8;ne({left:Math.max(Ge,Math.min(n.x,window.innerWidth-qe.width-Ge)),top:Math.max(Ge,Math.min(n.y,window.innerHeight-qe.height-Ge))})};return re(),window.addEventListener("resize",re),()=>window.removeEventListener("resize",re)},[n]),_.useEffect(()=>{if(!n)return;fe.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const re=window.requestAnimationFrame(()=>{var N,qe;(qe=(N=R.current)==null?void 0:N.querySelector("[role='menuitem']"))==null||qe.focus()});return()=>{var N;window.cancelAnimationFrame(re),(N=fe.current)==null||N.focus()}},[n]),!n)return null;const{file:V,x:se,y:ve}=n,ae=()=>{u(V,ie),J(!1),r()},A=re=>{const N=re.lastIndexOf(".");return N!==-1?re.slice(N):""},W=re=>{const N=Math.max(re.lastIndexOf("/"),re.lastIndexOf("\\"));return N!==-1?re.slice(0,N):re},le=re=>{const N=Math.max(re.lastIndexOf("/"),re.lastIndexOf("\\"));return N!==-1?re.slice(0,N):""};return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 z-[calc(var(--z-context-menu)-1)]",onClick:r,onContextMenu:re=>{re.preventDefault(),r()},"aria-hidden":"true"}),h.jsxs("div",{ref:R,role:"menu","aria-label":`Actions for ${V.filename}`,tabIndex:0,onKeyDown:re=>{var Ge,M,E,Y;["Escape","ArrowDown","ArrowUp","Home","End"].includes(re.key)&&re.stopPropagation();const N=Array.from(((Ge=R.current)==null?void 0:Ge.querySelectorAll("[role='menuitem']"))??[]),qe=N.indexOf(document.activeElement);if(re.key==="Escape")re.preventDefault(),r();else if(re.key==="ArrowDown"||re.key==="ArrowUp"){re.preventDefault();const oe=re.key==="ArrowDown"?1:-1;(M=N[(qe+oe+N.length)%N.length])==null||M.focus()}else re.key==="Home"?(re.preventDefault(),(E=N[0])==null||E.focus()):re.key==="End"&&(re.preventDefault(),(Y=N.at(-1))==null||Y.focus())},className:"animate-modal-in fixed z-[var(--z-context-menu)] max-h-[calc(100dvh-16px)] w-56 max-w-[calc(100vw-16px)] overflow-y-auto rounded-lg border border-line bg-surface-glass py-1 text-xs text-ink shadow-2xl backdrop-blur-md",style:B??{left:se,top:ve,visibility:"hidden"},children:[h.jsx("div",{className:"border-b border-line px-3 py-2 font-medium text-ink-muted truncate",children:V.filename}),h.jsxs("button",{role:"menuitem",onClick:()=>{a(V),r()},className:"flex w-full items-center gap-2 px-3 py-3 min-h-[44px] hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Launch ${V.filename}`,children:[h.jsx(er,{className:"h-3.5 w-3.5 fill-current text-status-success-text group-hover:text-white"}),h.jsx("span",{children:"Launch"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{J(!0)},className:"flex w-full items-center gap-2 px-3 py-3 min-h-[44px] hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Launch ${V.filename} with arguments`,children:[h.jsx(er,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Launch with arguments..."})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{s(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Reveal ${V.filename} in file manager`,children:[h.jsx(vd,{className:"h-3.5 w-3.5 text-chip-sky-text group-hover:text-white"}),h.jsx("span",{children:"Reveal in File Manager"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{d(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Open folder containing ${V.filename}`,children:[h.jsx(Ji,{className:"h-3.5 w-3.5 text-chip-amber-text group-hover:text-white"}),h.jsx("span",{children:"Open Folder"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{f(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Open terminal in directory containing ${V.filename}`,children:[h.jsx(kd,{className:"h-3.5 w-3.5 text-status-success-text group-hover:text-white"}),h.jsx("span",{children:"Open Terminal in Directory"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{D(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":"Generate QR Code",children:[h.jsx(Gd,{className:"h-3.5 w-3.5 text-chip-fuchsia-text group-hover:text-white"}),h.jsx("span",{children:"Generate QR Code"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{const re=W(V.path);m(re),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":"Scan to Directory",children:[h.jsx(Ji,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Scan to Directory"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{const re=le(V.rel_path);re&&p(re),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Filter view to folder ${V.filename} is in`,children:[h.jsx(wd,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Filter to Folder"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{const re=A(V.filename);re&&x(re),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Filter view by extension ${A(V.filename)}`,children:[h.jsx(wd,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Filter by Extension"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{y(V,!1),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy full path of ${V.filename}`,children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Full Path"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{y(V,!0),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy path of ${V.filename} with forward slashes`,children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Path (Forward Slashes)"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{g(V,!1),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy filename of ${V.filename}`,children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Filename"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{g(V,!0),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy filename of ${V.filename} without extension`,children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Filename (no ext)"})]}),h.jsxs("button",{role:"menuitem",onClick:async()=>{const re=W(V.path);r();try{await navigator.clipboard.writeText(re),$==null||$(`Copied: ${re}`)}catch(N){$==null||$(`Copy failed: ${(N==null?void 0:N.message)??N}`,"error")}},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":"Copy Directory",children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Directory"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{w(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy URI of ${V.filename}`,children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy URI"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{v(V,"md5"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Compute MD5 hash of ${V.filename}`,children:[h.jsx(Zr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Compute MD5 Hash"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{v(V,"sha256"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Compute SHA256 hash of ${V.filename}`,children:[h.jsx(Zr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Compute SHA256 Hash"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{S(V,"md5"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Verify MD5 hash of ${V.filename}`,children:[h.jsx(Zr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Verify MD5 Hash"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{S(V,"sha256"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Verify SHA256 hash of ${V.filename}`,children:[h.jsx(Zr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Verify SHA256 Hash"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{T(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`View properties of ${V.filename}`,children:[h.jsx(vd,{className:"h-3.5 w-3.5 text-chip-sky-text group-hover:text-white"}),h.jsx("span",{children:"Properties"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{L(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Remove ${V.filename} from list`,children:[h.jsx(Py,{className:"h-3.5 w-3.5 text-status-danger-text group-hover:text-white"}),h.jsx("span",{children:"Delete"})]})]}),I&&h.jsx("dialog",{ref:Q,className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 rounded-xl","aria-labelledby":"args-modal-title",onClick:re=>{re.target===Q.current&&J(!1)},onCancel:re=>{re.preventDefault(),J(!1)},children:h.jsxs("div",{className:"animate-modal-in w-96 rounded-xl border border-frame-line glass-panel p-4",children:[h.jsx("h3",{id:"args-modal-title",className:"mb-2 text-sm font-semibold text-ink",children:"Launch with Arguments"}),h.jsx("p",{className:"mb-3 text-xs text-ink-muted truncate",children:V.filename}),h.jsx("input",{type:"text",autoFocus:!0,placeholder:"Arguments (e.g. --verbose --port 80)",value:ie,onChange:re=>U(re.target.value),onKeyDown:re=>{re.key==="Enter"&&ae(),re.key==="Escape"&&J(!1)},className:"mb-4 w-full rounded-md border border-line bg-elevated px-3 py-2 text-xs text-ink outline-none focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500","aria-label":"Command line arguments"}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx("button",{onClick:()=>J(!1),className:"rounded-md px-3 py-1.5 text-xs text-ink-muted hover:bg-elevated hover:text-ink focus:outline-none focus:ring-2 focus:ring-indigo-500","aria-label":"Cancel launch",children:"Cancel"}),h.jsx("button",{onClick:ae,className:"btn btn-primary px-3 py-1.5","aria-label":`Launch ${V.filename} with arguments`,children:"Launch"})]})]})})]})}var ok=Vy();const bl=8,bi=8,sk=400,Ox={top:"bottom",bottom:"top",left:"right",right:"left"},ck={top:"-bottom-1 left-1/2 -translate-x-1/2",bottom:"-top-1 left-1/2 -translate-x-1/2",left:"-right-1 top-1/2 -translate-y-1/2",right:"-left-1 top-1/2 -translate-y-1/2"},fk={top:"border-b border-r",bottom:"border-t border-l",left:"border-t border-r",right:"border-b border-l"},Rx=(n,r,a)=>{switch(n){case"top":return r.top-bi-a.h>=bl;case"bottom":return r.bottom+bi+a.h<=window.innerHeight-bl;case"left":return r.left-bi-a.w>=bl;default:return r.right+bi+a.w<=window.innerWidth-bl}},dk=(n,r,a)=>{if(n==="top"||n==="bottom"){const f=r.left+r.width/2-a.w/2,m=window.innerWidth-a.w-bl;return{x:Math.min(Math.max(f,bl),Math.max(bl,m))-f,y:0}}const u=r.top+r.height/2-a.h/2,s=window.innerHeight-a.h-bl;return{x:0,y:Math.min(Math.max(u,bl),Math.max(bl,s))-u}},He=({text:n,children:r,block:a=!0,placement:u="top",suppress:s=!1})=>{const d=_.useRef(null),f=_.useRef(null),m=_.useId(),p=_.useRef(null),[x,y]=_.useState(!1),[g,w]=_.useState(u),[v,S]=_.useState({x:0,y:0}),[T,L]=_.useState({left:-9999,top:-9999}),D=()=>{p.current!==null&&(window.clearTimeout(p.current),p.current=null)};_.useEffect(()=>{s&&(D(),y(!1))},[s]),_.useEffect(()=>()=>D(),[]);const $=_.useCallback(()=>{const U=d.current,R=f.current;if(!U||!R)return;const Q=U.getBoundingClientRect(),fe={w:R.offsetWidth,h:R.offsetHeight},B=Rx(u,Q,fe)?u:Rx(Ox[u],Q,fe)?Ox[u]:u,ne=dk(B,Q,fe);w(B),S(ne);const V=Q.left+Q.width/2,se=Q.top+Q.height/2;L(B==="top"?{left:V,top:Q.top-bi-fe.h}:B==="bottom"?{left:V,top:Q.bottom+bi}:B==="left"?{left:Q.left-bi-fe.w,top:se}:{left:Q.right+bi,top:se})},[u]);_.useEffect(()=>{if(!x)return;const U=()=>y(!1);return window.addEventListener("resize",U),window.addEventListener("scroll",U,!0),()=>{window.removeEventListener("resize",U),window.removeEventListener("scroll",U,!0)}},[x]);const I=U=>{if(s)return;D();const R=()=>{$(),y(!0)};U?R():p.current=window.setTimeout(R,sk)},J=()=>{D(),y(!1)};_.useEffect(()=>{if(!x)return;const U=R=>{R.key==="Escape"&&y(!1)};return document.addEventListener("keydown",U,!0),()=>document.removeEventListener("keydown",U,!0)},[x]),_.useEffect(()=>{if(!x)return;const U=()=>!!document.querySelector('[role="dialog"][aria-modal="true"], dialog[open]');if(U()){y(!1);return}const R=new MutationObserver(()=>{U()&&y(!1)});return R.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["role","aria-modal","open","class"]}),()=>R.disconnect()},[x]);const ie={onMouseEnter:()=>I(!1),onMouseLeave:J,onFocus:()=>I(!0),onBlur:J,"aria-describedby":m};return h.jsxs("div",{ref:d,className:`group relative ${a?"flex min-w-0 flex-1 items-center":"inline-flex shrink-0 items-center"}`,onMouseEnter:()=>I(!1),onMouseLeave:J,onFocus:()=>I(!0),onBlur:J,children:[_.cloneElement(r,ie),ok.createPortal(h.jsxs("span",{ref:f,id:m,role:"tooltip",className:`pointer-events-none invisible fixed z-[var(--z-tooltip)] w-max max-w-[calc(100vw-16px)] rounded-md border border-line bg-elevated px-2 py-1 text-left text-[11px] leading-relaxed text-ink shadow-lg ${x?"visible opacity-100":"opacity-0"}`,style:{left:T.left,top:T.top,transform:g==="top"||g==="bottom"?`translateX(calc(-50% + ${v.x}px))`:`translateY(calc(-50% + ${v.y}px))`},children:[n,h.jsx("span",{className:`absolute h-2 w-2 rotate-45 border-line bg-elevated ${ck[g]} ${fk[g]}`,style:g==="top"||g==="bottom"?{left:`calc(50% - ${v.x}px)`}:void 0})]}),document.body)]})};function hk({isOpen:n,initialPath:r,onClose:a,onSelect:u}){const[s,d]=_.useState(null),[f,m]=_.useState(null),[p,x]=_.useState(""),[y,g]=_.useState(!1),[w,v]=_.useState(null),S=_.useRef(null),T=_.useRef(null),L=_.useRef(null);_.useEffect(()=>{var ie;if(!n){(ie=L.current)==null||ie.focus();return}L.current=document.activeElement instanceof HTMLElement?document.activeElement:null,v(null),D(r||"");const J=requestAnimationFrame(()=>{var U;return(U=T.current)==null?void 0:U.focus()});return()=>{var U;cancelAnimationFrame(J),(U=L.current)==null||U.focus()}},[n]);const D=async J=>{g(!0),v(null);try{const ie=await fetch(`/api/fs/browse?path=${encodeURIComponent(J)}`);if(!ie.ok)throw new Error("Failed to browse directory");const U=await ie.json();d(U),m(U.current_path),x(U.current_path)}catch(ie){v(ie.message||"Navigation failed")}finally{g(!1)}},$=()=>{const J=p.trim()||f;J&&(u(J),a())},I=J=>{var Q;if(J.key==="Escape"){J.preventDefault(),a();return}if(J.key!=="Tab")return;const ie=(Q=S.current)==null?void 0:Q.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(!(ie!=null&&ie.length))return;const U=ie[0],R=ie[ie.length-1];J.shiftKey&&document.activeElement===U?(J.preventDefault(),R.focus()):!J.shiftKey&&document.activeElement===R&&(J.preventDefault(),U.focus())};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/65 p-3 backdrop-blur-sm sm:p-6",onClick:a,children:h.jsxs("div",{ref:S,role:"dialog","aria-modal":"true","aria-labelledby":"directory-picker-title",onKeyDown:I,className:"animate-modal-in flex h-[min(84dvh,760px)] max-h-[calc(100dvh-1.5rem)] w-[min(94vw,960px)] min-h-0 flex-col overflow-hidden rounded-xl border border-frame-line glass-panel sm:rounded-2xl",onClick:J=>J.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-line px-4 py-3 sm:px-5",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Ji,{className:"h-5 w-5 text-chip-indigo-text"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{id:"directory-picker-title",className:"text-sm font-semibold text-ink",children:"Select a directory"}),h.jsx("p",{className:"truncate font-mono text-xs text-ink-muted",children:(s==null?void 0:s.current_path)||""})]})]}),h.jsx(He,{text:"Close",block:!1,children:h.jsx("button",{type:"button",onClick:a,"aria-label":"Close directory picker",className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg text-ink-muted transition-colors hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(nl,{className:"h-4 w-4"})})})]}),h.jsxs("div",{className:"border-b border-line px-4 py-3 sm:px-5",children:[h.jsx("label",{htmlFor:"directory-picker-path",className:"mb-1.5 block text-xs font-medium text-ink-secondary",children:"Location"}),h.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[h.jsx("input",{ref:T,id:"directory-picker-path",type:"text",value:p,onChange:J=>x(J.target.value),onKeyDown:J=>{J.key==="Enter"&&D(p.trim())},placeholder:"/path/to/directory",className:"h-10 min-w-0 flex-1 rounded-lg border border-line bg-elevated px-2.5 font-mono text-sm text-ink outline-none placeholder:text-ink-faint transition-colors hover:bg-surface-strong focus-visible:border-indigo-500 focus-visible:ring-2 focus-visible:ring-indigo-500/30"}),h.jsx("button",{type:"button",onClick:()=>D(p.trim()),className:"inline-flex h-10 shrink-0 items-center gap-1.5 rounded-lg border border-line bg-elevated px-3.5 text-sm font-medium text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Go"}),h.jsx(He,{text:"Home directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>D(""),"aria-label":"Home directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Yd,{className:"h-4 w-4"})})}),(s==null?void 0:s.parent_path)&&h.jsx(He,{text:"Parent directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>D(s.parent_path),"aria-label":"Parent directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Vd,{className:"h-4 w-4 rotate-180"})})})]})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 py-2 sm:px-3 sm:py-3","aria-busy":y,children:y?h.jsxs("div",{className:"flex h-full items-center justify-center gap-2.5 text-sm text-ink-muted",children:[h.jsx(Wi,{className:"h-5 w-5 animate-spin text-chip-indigo-text"}),h.jsx("span",{role:"status",children:"Loading directories…"})]}):w?h.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-2.5 text-center",children:[h.jsx("p",{className:"text-sm text-status-danger-text",children:w}),h.jsx("button",{type:"button",onClick:()=>D(p||(s==null?void 0:s.current_path)||""),className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Retry"})]}):h.jsxs("ul",{className:"space-y-0.5",children:[s==null?void 0:s.items.filter(J=>J.is_dir).map(J=>h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>D(J.path),onDoubleClick:()=>{x(J.path),u(J.path),a()},className:`flex min-h-10 w-full items-center justify-between rounded-lg px-3 py-1.5 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-400 ${f===J.path?"bg-chip-indigo-bg text-chip-indigo-text":"text-ink-secondary hover:bg-elevated hover:text-ink"}`,children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx(ss,{className:"h-5 w-5 shrink-0 text-chip-indigo-text"}),h.jsx("span",{className:"truncate",children:J.name})]}),f===J.path&&h.jsx(vi,{className:"h-4 w-4 shrink-0 text-chip-indigo-text"})]})},J.path)),(s==null?void 0:s.items.filter(J=>J.is_dir).length)===0&&h.jsxs("li",{className:"flex h-full min-h-36 flex-col items-center justify-center gap-2.5 text-center text-sm text-ink-muted",children:[h.jsx(Ji,{className:"h-7 w-7 text-ink-faint"}),"No subdirectories found"]})]})}),h.jsxs("div",{className:"flex flex-col gap-2 border-t border-line px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"mb-0.5 text-xs font-medium text-ink-muted",children:"Selected folder"}),h.jsx("p",{className:"truncate font-mono text-sm text-ink",title:f||p,children:f||p||"—"})]}),h.jsxs("div",{className:"flex shrink-0 justify-end gap-1.5",children:[h.jsx("button",{type:"button",onClick:a,className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Cancel"}),h.jsxs("button",{type:"button",onClick:$,disabled:!p.trim(),className:"btn btn-primary min-h-10 rounded-lg px-4 text-sm font-semibold",children:[h.jsx(Ji,{className:"h-4 w-4"}),"Select folder"]})]})]})]})}):null}function mk({visible:n,onFileSelected:r}){const a=_.useRef(null);return n?h.jsxs("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-drop-overlay)] flex items-center justify-center bg-black/65 backdrop-blur-sm",onClick:()=>{var u;return(u=a.current)==null?void 0:u.click()},"data-testid":"drop-config-overlay",children:[h.jsx("input",{ref:a,type:"file",accept:".profiles,.profiles.yaml,.profiles.yml,.yaml,.yml",className:"hidden",onChange:u=>{var d;const s=(d=u.target.files)==null?void 0:d[0];s&&r(s),u.target.value=""}}),h.jsxs("div",{className:"rounded-xl border-2 border-dashed border-chip-indigo-border bg-surface px-8 py-6 text-center shadow-2xl",children:[h.jsx("span",{className:"mx-auto mb-3 grid h-9 w-9 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Kr,{className:"h-5 w-5 text-chip-indigo-text"})}),h.jsx("p",{className:"text-sm font-semibold text-ink",children:"Drop configuration file"}),h.jsx("p",{className:"mt-1 text-xs text-ink-muted",children:".profiles, .profiles.yaml, .yml, .yaml — session-only preview"})]})]}):null}function pk({items:n,columnTemplate:r,resizePointerRef:a,resizeMovedRef:u}){return h.jsx("div",{className:"grid select-none items-center border-b border-l-2 border-l-transparent border-line/40 bg-surface/60 font-medium text-ink-muted shadow-sm backdrop-blur-md",role:"row","aria-rowindex":1,"data-file-list-header":!0,style:{gridTemplateColumns:r},children:n.map((s,d)=>{const f=!!(s.onSort&&s.sortKey),m=s.active?s.direction==="asc"?"ascending":"descending":"none";return h.jsxs("div",{role:"columnheader","data-column-key":s.sortKey,className:`group relative flex items-center gap-1.5 truncate px-3 py-2 ${f?"cursor-pointer hover:text-ink transition-colors":""} ${s.active?"text-ink":""}`,...f?{"aria-sort":m,tabIndex:0,onClick:s.onSort,onKeyDown:p=>{var x;(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),(x=s.onSort)==null||x.call(s))}}:{},children:[s.icon,h.jsx("span",{className:"truncate",children:s.label}),f?s.active?s.direction==="asc"?h.jsx(q2,{className:"ml-auto h-3 w-3 shrink-0 text-chip-indigo-text"}):h.jsx(Qy,{className:"ml-auto h-3 w-3 shrink-0 text-chip-indigo-text"}):h.jsx(Dx,{className:"ml-auto h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-40 hover:opacity-40"}):d>0&&h.jsx(Dx,{className:"ml-auto h-3 w-3 shrink-0 opacity-40"}),s.canResize&&s.onResizeBy&&h.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize ${s.label} column`,"aria-valuemin":$r,"aria-valuemax":ls,"aria-valuenow":s.width??s.defaultWidth??es,"aria-valuetext":`${s.width??s.defaultWidth??es} pixels wide`,title:"Drag to resize; use arrow keys or click either side to adjust",tabIndex:0,onClick:p=>{var g;p.preventDefault(),p.stopPropagation();const x=u.current;if(u.current=!1,x)return;const y=p.currentTarget.getBoundingClientRect();(g=s.onResizeBy)==null||g.call(s,p.clientX{p.preventDefault(),p.stopPropagation();const x=p.currentTarget.parentElement;u.current=!1,a.current={pointerId:p.pointerId,startX:p.clientX,startWidth:s.width??(x==null?void 0:x.getBoundingClientRect().width)??s.defaultWidth??es,resizeTo:s.onResizeTo},p.currentTarget.setPointerCapture(p.pointerId)},onPointerMove:p=>{const x=a.current;if(!x||x.pointerId!==p.pointerId)return;const y=p.clientX-x.startX;Math.abs(y)>2&&(u.current=!0),x.resizeTo(x.startWidth+y)},onPointerUp:p=>{var x;((x=a.current)==null?void 0:x.pointerId)===p.pointerId&&(p.currentTarget.releasePointerCapture(p.pointerId),a.current=null,window.setTimeout(()=>{u.current=!1},0))},onPointerCancel:()=>{a.current=null,u.current=!1},onKeyDown:p=>{var x,y;p.stopPropagation(),p.key==="ArrowLeft"||p.key==="ArrowRight"?(p.preventDefault(),(x=s.onResizeBy)==null||x.call(s,p.key==="ArrowLeft"?-Yo:Yo)):(p.key==="Home"||p.key==="End")&&(p.preventDefault(),(y=s.onResizeTo)==null||y.call(s,p.key==="Home"?$r:ls))},className:"absolute inset-y-0 right-0 z-10 w-3 cursor-col-resize touch-none border-r border-transparent transition-colors hover:border-indigo-400 focus-visible:border-indigo-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500"})]},d)})})}const Wn=28,Vo=12,ed=500,$r=80,ls=960,es=160,Yo=24,Lx=44,Go={File:2,Path:3,FileName:1,Type:1,Version:1};function gk({files:n,totalCount:r,rawLoadedCount:a,onLoadMore:u,loadingMore:s=!1,scanning:d=!1,hasScanned:f=!1,activeDirectory:m="",recursive:p=!1,onDisableRecursive:x,onOpenDirectory:y,onOpenConfig:g,filterText:w,onClearFilter:v,prefilterNote:S,columnHeaders:T,columnNames:L,selectedIndex:D,onSelectIndex:$,onLaunch:I,onContextMenu:J,rowColors:ie,sort:U,onSortChange:R}){const Q=["File"],fe=L.length>0?L:Q,B=T.length>0?T:fe,ne=Array.from({length:Math.max(fe.length,B.length)},(ge,Me)=>({key:fe[Me]??Q[0],header:B[Me]??fe[Me]??Q[0]})),V=_.useRef(null),[se,ve]=_.useState(0),[ae,A]=_.useState(600),[W,le]=_.useState(0),[re,N]=_.useState({}),qe=_.useRef(null),Ge=_.useRef(!1),M=fe.reduce((ge,Me)=>ge+(Go[Me]??1),1),E=(ge,Me)=>{const Le=Math.min(ls,Math.max($r,Math.round(Me)));N(lt=>({...lt,[ge]:Le}))},Y=(ge,Me)=>{var K;const Le=Array.from(((K=V.current)==null?void 0:K.querySelectorAll("[data-column-key]"))??[]).find(ue=>ue.dataset.columnKey===ge),lt=re[ge]??(Le==null?void 0:Le.getBoundingClientRect().width)??es;E(ge,lt+Me)},oe=[`${Lx}px`,...fe.map(ge=>re[ge]?`${re[ge]}px`:`minmax(${$r}px, ${Go[ge]??1}fr)`)].join(" "),de=_.useRef(!1),je=_.useRef(null),ye=n.length,_e=a??ye,pe=r??_e,Se=_e{const ge=V.current;if(!ge)return;const Me=new ResizeObserver(Le=>{for(const lt of Le)A(lt.contentRect.height),le(lt.contentRect.width)});return Me.observe(ge),A(ge.clientHeight||600),le(ge.clientWidth||0),()=>Me.disconnect()},[]),_.useEffect(()=>{var ue;const ge=V.current;if(!ge||D<0||D>=ye)return;const Me=((ue=ge.querySelector("[data-file-list-header]"))==null?void 0:ue.offsetHeight)??0,Le=Me+D*Wn,lt=Le+Wn;let K=ge.scrollTop;Lege.scrollTop+ge.clientHeight&&(K=lt-ge.clientHeight),K!==ge.scrollTop&&(ge.scrollTop=K,ve(K))},[D,ye]),_.useEffect(()=>{const ge=V.current;if(!ge)return;const Me=()=>{if(de.current||!Bt||!u)return;const Le=ge.scrollTop+ge.clientHeight,lt=ye*Wn;lt-LeLe&&(de.current=!0,window.setTimeout(()=>{de.current=!1},200),u())};return ge.addEventListener("scroll",Me,{passive:!0}),window.addEventListener("scroll",Me,{passive:!0}),()=>{ge.removeEventListener("scroll",Me),window.removeEventListener("scroll",Me)}},[n,Bt,u,ye]),_.useEffect(()=>{if(de.current||!Bt||!u)return;const ge=ye*Wn,Me=se+ae;if(!(ge-MeMe))return;const lt=`${ye}:${_e}:${pe}`;je.current=lt,u()});const Gt=_.useCallback(ge=>{ve(ge.currentTarget.scrollTop)},[]),St=Math.max(0,Math.floor(se/Wn)-Vo),nt=Math.ceil(ae/Wn)+Vo*2,Je=Math.min(ye,St+nt),en=St*Wn,bn=(ge,Me)=>{if(Me)return{className:"bg-chip-indigo-bg border-l-4 border-chip-indigo-border text-ink",style:{}};for(const[Le,lt]of ie)if(ge.toLowerCase().includes(Le.toLowerCase()))return{className:"hover:bg-elevated border-l-4 text-ink",style:{borderLeftColor:lt,borderLeftWidth:"4px"}};return{className:"border-l-4 border-transparent text-ink-secondary hover:bg-elevated/60",style:{borderLeftColor:"transparent",borderLeftWidth:"4px"}}},tn=(Bt?ye+nt:ye)*Wn,Ht="btn btn-secondary px-3 py-1.5";return h.jsxs("div",{ref:V,onScroll:Gt,className:"flex-1 overflow-auto bg-app text-xs transition-colors duration-200 focus-visible:outline focus-visible:outline-2 focus-visible:outline-indigo-500 focus-visible:outline-offset-[-2px]","data-testid":"file-list","data-loaded-count":_e,"aria-busy":d,role:"grid","aria-label":"Discovered files","aria-rowcount":Math.max(pe,ye===0?1:0)+1,"aria-colcount":fe.length+1,"aria-activedescendant":ye>0?`file-row-${D}`:void 0,tabIndex:0,children:[h.jsx("div",{className:"sticky top-0 z-10",role:"presentation",children:h.jsx(pk,{columnTemplate:oe,resizePointerRef:qe,resizeMovedRef:Ge,items:[{label:"#",icon:h.jsx(wd,{className:"h-3.5 w-3.5"})},...ne.map(({key:ge,header:Me})=>({label:Me,weight:Go[ge]??1,width:re[ge],defaultWidth:Math.min(ls,Math.max($r,Math.round((W-Lx)*(Go[ge]??1)/M))),canResize:!0,onResizeBy:Le=>Y(ge,Le),onResizeTo:Le=>E(ge,Le),sortKey:ge,active:(U==null?void 0:U.column)===ge,direction:U==null?void 0:U.direction,onSort:()=>{(U==null?void 0:U.column)!==ge?R({column:ge,direction:"asc"}):U.direction==="asc"?R({column:ge,direction:"desc"}):R(null)}}))]})}),S&&ye>0&&h.jsxs("div",{role:"note","data-testid":"prefilter-note",className:"flex items-center gap-1.5 border-b border-line/40 bg-surface px-3 py-1 text-[11px] text-ink-faint",children:[h.jsx(Ky,{className:"h-3 w-3 shrink-0 text-ink-faint","aria-hidden":"true"}),h.jsx("span",{className:"min-w-0 truncate",children:S})]}),ye===0?h.jsx("div",{role:"row","aria-rowindex":2,"data-testid":"file-list-empty",children:h.jsx("div",{role:"gridcell","aria-colspan":fe.length+1,className:"p-8 text-center text-ink-faint",children:d?h.jsxs("div",{className:"flex flex-col items-center gap-2",children:[h.jsx(Wi,{className:"h-5 w-5 animate-spin text-chip-indigo-text motion-reduce:animate-none"}),h.jsx("span",{children:"Scanning files..."})]}):!m.trim()&&g?h.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h.jsx("span",{children:"Select a directory first."}),h.jsx("button",{type:"button",onClick:g,className:Ht,children:"Choose configuration"})]}):f?w.trim()?h.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h.jsxs("span",{children:["No files match “",w,"”."]}),h.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[h.jsx("button",{type:"button",onClick:v,className:Ht,children:"Clear filter"}),p&&x&&h.jsx("button",{type:"button",onClick:x,className:Ht,children:"Turn off recursive"}),y&&h.jsx("button",{type:"button",onClick:y,className:Ht,children:"Open directory"})]})]}):h.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h.jsx("span",{children:"No files found for the current directory and extension."}),h.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[p&&x&&h.jsx("button",{type:"button",onClick:x,className:Ht,children:"Turn off recursive"}),y&&h.jsx("button",{type:"button",onClick:y,className:Ht,children:"Open directory"})]})]}):h.jsx("span",{children:"Select a directory and scan to find files."})})}):h.jsxs("div",{className:"relative",style:{height:tn},role:"rowgroup",children:[s&&h.jsx("div",{className:"pointer-events-none absolute left-1/2 top-2 z-20 -translate-x-1/2","aria-hidden":"true",children:h.jsx(Wi,{className:"h-4 w-4 animate-spin text-chip-indigo-text"})}),h.jsx("div",{style:{transform:`translateY(${en}px)`},"data-testid":"file-list-window",role:"presentation",children:n.slice(St,Je).map((ge,Me)=>{const Le=St+Me,lt=Le===D,K=bn(ge.filename,lt);return h.jsxs("div",{id:`file-row-${Le}`,"data-row-index":Le,role:"row","aria-rowindex":Le+2,"aria-selected":lt,onClick:()=>{var ue;$(Le),(ue=V.current)==null||ue.focus()},onDoubleClick:()=>I(ge),onContextMenu:ue=>J(ue,ge,Le),className:`grid cursor-pointer items-center transition-colors ${K.className}`,style:{...K.style,height:Wn,gridTemplateColumns:oe},children:[h.jsxs("div",{className:"flex items-center justify-end gap-1 px-3 font-mono text-ink-faint",children:[ge.has_hook&&h.jsx("span",{title:ge.hook_pattern?`Launch workflow: ${ge.hook_pattern}`:"Launch workflow configured","aria-label":"Workflow hook attached",className:"inline-flex items-center text-status-warning-text hover:brightness-95",children:h.jsx(eb,{className:"h-3 w-3 shrink-0"})}),h.jsx("span",{className:"hidden sm:inline",children:Le+1})]}),fe.map((ue,ke)=>{const Ce=ge.column_values[ue]||(ue==="File"?ge.filename:"-");return h.jsx("div",{role:"gridcell","data-column-key":ue,className:"truncate px-3 font-mono",style:{minWidth:$r},title:ue==="Path"?ge.path:Ce,children:Ce},ke)})]},ge.path||Le)})}),Se&&h.jsxs("div",{className:"pointer-events-none absolute bottom-2 left-1/2 -translate-x-1/2 rounded-full border border-line bg-surface-strong px-3 py-1 text-[11px] text-ink-muted shadow","data-testid":"file-list-paging",children:[s?h.jsx(R2,{className:"mr-1.5 h-4 w-4 animate-spin motion-reduce:animate-none text-ink-muted"}):null,"(",_e," of ",pe," loaded)"]})]})]})}function Sd({id:n,ariaLabel:r,value:a,options:u,onChange:s,placeholder:d,className:f="",inputClassName:m="",optionLabel:p=y=>y,onOpenChange:x}){const y=_.useId(),g=_.useRef(null),[w,v]=_.useState(!1),[S,T]=_.useState(""),[L,D]=_.useState(-1),$=u.filter(R=>p(R).toLocaleLowerCase().includes(S.toLocaleLowerCase())),I=L>=0&&$[L]?`${y}-option-${L}`:void 0;_.useEffect(()=>{const R=Q=>{var fe;(fe=g.current)!=null&&fe.contains(Q.target)||v(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]),_.useEffect(()=>{x==null||x(w)},[w,x]),_.useEffect(()=>{var R;L<0||(R=document.getElementById(`${y}-option-${L}`))==null||R.scrollIntoView({block:"nearest"})},[L,y]);const J=()=>{T(""),D(-1),v(!0)},ie=R=>{s(R),T(""),D(-1),v(!1)},U=R=>{if(R.key==="ArrowDown"){if(R.preventDefault(),!w){J(),D(0);return}D(Q=>Math.min(Q+1,$.length-1))}else if(R.key==="ArrowUp"){if(R.preventDefault(),!w){J(),D($.length-1);return}D(Q=>Q<=0?$.length-1:Q-1)}else R.key==="Enter"&&w&&$[L]!==void 0?(R.preventDefault(),ie($[L])):R.key==="Escape"&&v(!1)};return h.jsxs("div",{ref:g,onBlur:R=>{var Q;(Q=g.current)!=null&&Q.contains(R.relatedTarget)||v(!1)},className:`relative flex min-w-0 ${f}`,children:[h.jsx("input",{id:n,type:"text",role:"combobox","aria-label":r,"aria-autocomplete":"list","aria-expanded":w,"aria-controls":y,"aria-activedescendant":I,value:a,placeholder:d,onChange:R=>{s(R.target.value),T(R.target.value),D(-1),v(!0)},onKeyDown:U,className:`min-w-0 flex-1 rounded-l-md border border-line bg-elevated px-3 py-1.5 text-ink outline-none transition-colors hover:bg-surface-strong focus:border-indigo-500 ${m}`}),h.jsx("button",{type:"button","aria-label":`Show ${r.toLowerCase()} options`,"aria-expanded":w,title:`Show ${r.toLowerCase()} options`,onMouseDown:R=>R.preventDefault(),onClick:()=>w?v(!1):J(),className:"shrink-0 rounded-r-md border border-l-0 border-line bg-elevated px-2 text-ink-muted hover:bg-surface-strong hover:text-ink focus-visible:z-10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-indigo-500 transition-colors",children:h.jsx(K2,{className:`h-3.5 w-3.5 transition-transform ${w?"rotate-180":""}`})}),w&&h.jsx("ul",{id:y,role:"listbox","aria-label":`${r} options`,className:"absolute left-0 top-full z-[var(--z-combobox-list)] mt-1 max-h-60 w-full min-w-48 overflow-y-auto rounded-md border border-line bg-surface py-1 text-ink shadow-xl",children:$.length>0?$.map((R,Q)=>{const fe=p(R),B=Q===L,ne=R===a;return h.jsx("li",{id:`${y}-option-${Q}`,role:"option","aria-selected":ne,title:fe||void 0,onMouseEnter:()=>D(Q),onMouseDown:V=>V.preventDefault(),onClick:()=>ie(R),className:`cursor-pointer truncate px-3 py-1.5 ${B?"bg-elevated text-ink":"text-ink-secondary"} ${ne?"font-semibold":""}`,children:fe||"(No filter)"},`${R}-${Q}`)}):h.jsx("li",{className:"px-3 py-1.5 text-ink-muted",children:"No matching presets"})})]})}function xk({title:n,release:r,directories:a,activeDirectory:u,onDirectoryChange:s,onBrowseDirectory:d,onGoToParentDirectory:f,onGoToHomeDirectory:m,onOpenActiveDirectory:p,onOpenTerminal:x}){const[y,g]=_.useState(!1);return h.jsxs("header",{className:"relative z-30 flex flex-wrap items-center gap-3 border-b border-line bg-app/90 px-5 py-2 text-xs backdrop-blur-xl shadow-xs transition-all duration-200",children:[h.jsx("div",{className:"flex shrink-0 items-center gap-3",children:h.jsxs("div",{className:"flex items-center gap-3.5",children:[h.jsxs("div",{className:"relative flex h-9 w-9 items-center justify-center rounded-xl bg-gradient-to-br from-chip-indigo-bg to-chip-purple-bg text-chip-indigo-text border border-chip-indigo-border shadow-xs",children:[h.jsx(kd,{className:"h-4 w-4"}),h.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 flex h-2.5 w-2.5 items-center justify-center rounded-full bg-emerald-500 ring-2 ring-app"})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h1",{className:"text-sm font-bold tracking-tight text-ink font-heading",children:"ProFiles"}),n&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-ink-faint",children:"/"}),h.jsx("span",{className:"text-xs font-medium text-chip-indigo-text bg-chip-indigo-bg px-2 py-0.5 rounded-md border border-chip-indigo-border/50",children:n})]})]}),h.jsxs("p",{className:"text-[11px] font-medium text-ink-muted tracking-wide mt-0.5",children:["Crafted by ",h.jsx("span",{className:"text-ink font-semibold",children:"Florent ALBANY"})," • ",h.jsxs("span",{className:"font-mono text-chip-indigo-text",children:["v",r||"0.11.0-rc.2"]})]})]})]})}),h.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[h.jsxs("label",{className:"flex shrink-0 items-center gap-1.5 font-medium text-ink-secondary text-xs",children:[h.jsx(ss,{className:"h-3.5 w-3.5 text-chip-indigo-text"}),h.jsx("span",{children:"Directory:"})]}),h.jsx(He,{text:"Select or type a directory path to scan files from.",suppress:y,children:h.jsx(Sd,{id:"directory-combobox",ariaLabel:"Directory",value:u,options:a,onChange:s,onOpenChange:g,placeholder:"/path/to/directory",className:"w-full",inputClassName:"font-mono"})}),p&&h.jsx(He,{text:"Open the active directory in the OS file manager",block:!1,children:h.jsx("button",{type:"button",onClick:p,"aria-label":"Open active directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(U2,{className:"h-3.5 w-3.5"})})}),f&&h.jsx(He,{text:"Go to parent directory",block:!1,children:h.jsx("button",{type:"button",onClick:f,"aria-label":"Go to parent directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Vd,{className:"h-3.5 w-3.5 rotate-180"})})}),d&&h.jsx(He,{text:"Browse for a folder on this system",block:!1,children:h.jsx("button",{type:"button",onClick:d,"aria-label":"Browse directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Ji,{className:"h-3.5 w-3.5"})})}),x&&h.jsx(He,{text:"Open the active directory in a terminal",block:!1,children:h.jsx("button",{type:"button",onClick:()=>x(u),"aria-label":"Open directory in terminal",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(kd,{className:"h-3.5 w-3.5"})})}),m&&h.jsx(He,{text:"Set directory to your home folder",block:!1,children:h.jsx("button",{type:"button",onClick:m,"aria-label":"Go to home directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Yd,{className:"h-3.5 w-3.5"})})})]})]})}function yk({message:n,onRetry:r,retrying:a=!1}){return h.jsx("div",{className:"flex flex-1 items-center justify-center p-8",role:"alert","data-testid":"init-error-panel",children:h.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-line bg-surface p-6 text-center shadow-xl",children:[h.jsx("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-full border border-status-danger-border bg-status-danger-bg",children:h.jsx(lu,{className:"h-5 w-5 text-status-danger-text/80"})}),h.jsx("h3",{className:"text-sm font-semibold text-ink",children:"Couldn't load the app"}),h.jsx("p",{className:"mt-1 break-words text-xs text-ink-secondary",children:n}),h.jsxs("button",{type:"button",onClick:r,disabled:a,className:"btn btn-primary mx-auto mt-4 px-3.5 py-1.5 font-semibold shadow-sm",children:[h.jsx(cs,{className:`h-3.5 w-3.5 ${a?"animate-spin motion-reduce:animate-none":""}`}),h.jsx("span",{children:a?"Retrying...":"Retry"})]})]})})}const Ux=/"([^"]*)"|(\S+)/g,Bx=/"([^"]*)"/g,bk="Unmatched quote";function vk(n){const r=[];let a;for(Ux.lastIndex=0;(a=Ux.exec(n))!==null;){const f=a[1]!==void 0?a[1]:a[2];f&&f.trim()&&r.push(f)}let u="",s=0;Bx.lastIndex=0;let d;for(;(d=Bx.exec(n))!==null;)u+=n.slice(s,d.index),s=d.index+d[0].length;return u+=n.slice(s),{terms:r,error:u.includes('"')?bk:null}}function tb(n){const r=n.trim();if(!r)return{error:null,groups:[]};const{terms:a,error:u}=vk(r);if(a.length===0)return{error:u,groups:[]};const s=[];let d={includes:[],excludes:[]};for(const f of a){if(f.toUpperCase()==="OR"){s.push(d),d={includes:[],excludes:[]};continue}f==="-"||f==="+"||(f.startsWith("-")&&f.length>1?d.excludes.push(f.slice(1)):f.startsWith("+")&&f.length>1?d.includes.push(f.slice(1)):d.includes.push(f))}return s.push(d),{error:u,groups:s}}const wk=256,Ki=new Map;function Hx(n){return n.toLowerCase()}function kk(n){const r=Ki.get(n);if(r)return Ki.delete(n),Ki.set(n,r),r;const{groups:a}=tb(n),u={groups:a.map(s=>({includes:s.includes.map(Hx),excludes:s.excludes.map(Hx)}))};if(Ki.size>=wk){const s=Ki.keys().next().value;s!==void 0&&Ki.delete(s)}return Ki.set(n,u),u}function Sk(n,r){return r.includes.every(a=>n.includes(a))&&!r.excludes.some(a=>n.includes(a))}function Nk(n,r){const{groups:a}=kk(r);if(a.length===0)return!0;const u=n.toLowerCase();return a.some(s=>Sk(u,s))}function Ek({query:n,visible:r}){if(!r)return null;const a=tb(n);return a.error?h.jsx("div",{"data-testid":"filter-syntax-helper",className:"pointer-events-none absolute left-0 right-0 top-full z-[var(--z-syntax-helper)] mt-1 rounded-md border border-status-danger-border bg-surface-strong px-3 py-2 text-[11px] leading-5 text-status-danger-text/90 shadow-xl",children:a.error}):a.groups.length===0?null:h.jsxs("div",{"data-testid":"filter-syntax-helper",className:"pointer-events-none absolute left-0 right-0 top-full z-[var(--z-syntax-helper)] mt-1 rounded-md border border-line bg-surface-strong px-3 py-2 text-[11px] leading-5 text-ink-secondary shadow-xl",children:[h.jsx("span",{className:"mr-1.5 align-[1px] text-[10px] uppercase tracking-wide text-ink-muted",children:"reads as"}),a.groups.map((u,s)=>h.jsxs("span",{"data-testid":"filter-syntax-group",children:[s>0&&h.jsx("span",{className:"mx-1 font-mono text-chip-indigo-text",children:"OR"}),u.includes.map((d,f)=>h.jsxs("span",{children:[f>0&&h.jsx("span",{className:"text-ink-muted",children:" · "}),h.jsx("span",{className:"font-mono text-chip-indigo-text",children:d})]},`i-${f}`)),u.includes.length>0&&u.excludes.length>0&&h.jsx("span",{className:"text-ink-muted",children:" · "}),u.excludes.map((d,f)=>h.jsxs("span",{children:[f>0&&h.jsx("span",{className:"text-ink-muted",children:" · "}),h.jsx("span",{className:"text-ink-muted",children:"✕ "}),h.jsx("span",{className:"font-mono text-status-danger-text/70 line-through",children:d})]},`x-${f}`))]},s))]})}const qx=h.jsxs("span",{className:"flex flex-col gap-1 whitespace-nowrap text-left",children:[h.jsx("span",{className:"font-semibold",children:"Supported operators"}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"a b"})," — AND (both terms)"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"a OR b"})," — either term"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"-a"})," — NOT (exclude)"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"+a"})," — force include"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:'"a b"'})," — exact phrase"]})]});function jk({extensions:n,activeExtension:r,onExtensionChange:a,filterOptions:u,filterText:s,onFilterTextChange:d,recursive:f,onRecursiveChange:m,onScan:p,scanning:x,barcodeMode:y,onBarcodeToggle:g,onCameraBarcodeClick:w,autoRescanActive:v,onTimerClick:S}){const[T,L]=_.useState(!1),[D,$]=_.useState(!1),[I,J]=_.useState(!1);return h.jsxs("div",{className:"flex w-full flex-wrap items-center gap-3 border-b border-line bg-surface-glass p-3 text-xs",children:[h.jsx(He,{text:qx,suppress:D,children:h.jsxs("div",{className:"relative min-w-0 flex-1 basis-64",onFocusCapture:ie=>{ie.target.tagName==="INPUT"&&L(!0)},onBlurCapture:ie=>{ie.target.tagName==="INPUT"&&L(!1)},children:[h.jsx($y,{className:"pointer-events-none absolute left-3 top-1/2 z-10 h-4 w-4 -translate-y-1/2 text-ink-secondary"}),h.jsx(Sd,{id:"filter-combobox",ariaLabel:"File filter",value:s,options:u||[],onChange:d,onOpenChange:$,placeholder:"Filter files: keyword, a OR b, -tag, exact phrase...",className:"w-full",inputClassName:"pl-9 pr-3",optionLabel:ie=>ie||"(No filter)"}),h.jsx(Ek,{query:s,visible:T&&!D&&s.trim().length>0})]})}),h.jsx(He,{text:qx,block:!1,suppress:I,children:h.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[h.jsx("span",{className:"text-ink-muted",children:"Ext:"}),h.jsx(Sd,{id:"extension-combobox",ariaLabel:"Extension filter",value:r,options:n,onChange:a,onOpenChange:J,placeholder:".py OR .toml",className:"w-44",inputClassName:"font-mono px-2.5"})]})}),h.jsx(He,{text:"Include subdirectories when scanning",block:!1,children:h.jsxs("label",{className:"flex shrink-0 cursor-pointer select-none items-center gap-1.5 text-ink-secondary",children:[h.jsx("input",{type:"checkbox",checked:f,onChange:ie=>m(ie.target.checked),className:"rounded border-line text-chip-indigo-text focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-1 focus-visible:ring-offset-app"}),h.jsx("span",{children:"Recursive"})]})}),h.jsx(He,{text:"Run the scan with the current criteria (Enter)",block:!1,children:h.jsxs("button",{onClick:p,disabled:x,className:"btn btn-primary shrink-0 px-3.5 py-1.5 font-semibold shadow-sm",children:[x?h.jsx(cs,{className:"h-3.5 w-3.5 animate-spin motion-reduce:animate-none"}):h.jsx(er,{className:"h-3.5 w-3.5 fill-current"}),h.jsx("span",{children:x?"Scanning...":"Scan"})]})}),h.jsx(He,{text:v?"Auto-rescan is active. Click to configure.":"Configure periodic auto-rescan (hot-folder mode)",block:!1,children:h.jsx("button",{type:"button",onClick:S,"aria-label":"Configure timer / auto-rescan",className:`flex shrink-0 items-center justify-center rounded-md border p-1.5 text-ink-secondary hover:border-indigo-500 hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 transition-colors ${v?"border-chip-indigo-border bg-chip-indigo-bg text-chip-indigo-text":"border-line bg-elevated"}`,children:h.jsx(Jy,{className:`h-3.5 w-3.5 ${v?"animate-pulse":""}`})})}),h.jsx(He,{text:"Toggle barcode scanner mode (USB HID). When active, scan a barcode to auto-fill controls and trigger a scan.",block:!1,children:h.jsx("button",{type:"button",onClick:g,"aria-label":y?"Disable barcode mode":"Enable barcode mode",className:`flex shrink-0 items-center justify-center rounded-md border p-1.5 text-ink-secondary hover:border-indigo-500 hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 transition-colors ${y?"border-chip-indigo-border bg-chip-indigo-bg text-chip-indigo-text":"border-line bg-elevated"}`,children:h.jsx(Gd,{className:`h-3.5 w-3.5 ${y?"animate-pulse":""}`})})}),w&&h.jsx(He,{text:"Scan barcode or QR code using webcam / camera (Ctrl + Shift + B)",block:!1,children:h.jsx("button",{type:"button",onClick:w,"aria-label":"Scan barcode with camera",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Xy,{className:"h-3.5 w-3.5"})})})]})}const Ck=2e3,Tk=500,_k=[{value:null,label:"ALL"},{value:"DEBUG",label:"DEBUG"},{value:"INFO",label:"INFO"},{value:"WARNING",label:"WARNING"},{value:"ERROR",label:"ERROR"},{value:"CRITICAL",label:"CRITICAL"}],Fx={DEBUG:{icon:V2,className:"text-chip-sky-text"},INFO:{icon:Ky,className:"text-status-success-text"},WARNING:{icon:Wy,className:"text-status-warning-text"},ERROR:{icon:bd,className:"text-status-danger-text"},CRITICAL:{icon:bd,className:"text-status-danger-text"},UNKNOWN:{icon:Pr,className:"text-ink-faint"}};function Ak({isOpen:n,onClose:r,onOpenExternally:a}){const[u,s]=_.useState([]),[d,f]=_.useState("profiles.log"),[m,p]=_.useState(0),[x,y]=_.useState(null),[g,w]=_.useState(""),[v,S]=_.useState(!1),[T,L]=_.useState(!0),[D,$]=_.useState(null),[I,J]=_.useState(!0),ie=_.useRef(null),U=_.useRef(null),R=_.useRef(null),Q=_.useRef(null),fe=_.useRef(T),B=_.useRef({level:x,search:g});fe.current=T,B.current={level:x,search:g};const ne=_.useCallback(async()=>{const{level:A,search:W}=B.current;S(!0);try{const le=await o2({limit:Tk,level:A,search:W});s(le.entries),f(le.path),p(le.size_bytes),$(null)}catch(le){$((le==null?void 0:le.message)||"Failed to read the log file")}finally{S(!1)}},[]);_.useEffect(()=>{n&&ne()},[n,ne]),_.useEffect(()=>{if(!n||!T)return;const A=window.setInterval(()=>{ne()},Ck);return()=>window.clearInterval(A)},[n,T,ne]),_.useEffect(()=>{if(!n)return;const A=window.setTimeout(()=>void ne(),250);return()=>window.clearTimeout(A)},[n,x,g,ne]),_.useEffect(()=>{if(!I)return;const A=R.current;A&&(A.scrollTop=A.scrollHeight)},[u,I]),_.useEffect(()=>{if(!n)return;const A=document.activeElement instanceof HTMLElement?document.activeElement:null,W=requestAnimationFrame(()=>{var le;return(le=U.current)==null?void 0:le.focus()});return()=>{cancelAnimationFrame(W),A==null||A.focus()}},[n]);const V=A=>{var N;if(A.key==="Escape"){A.preventDefault(),r();return}if(A.key!=="Tab")return;const W=(N=ie.current)==null?void 0:N.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(!(W!=null&&W.length))return;const le=W[0],re=W[W.length-1];A.shiftKey&&document.activeElement===le?(A.preventDefault(),re.focus()):!A.shiftKey&&document.activeElement===re&&(A.preventDefault(),le.focus())},se=()=>{const A=R.current;if(!A)return;const W=A.scrollHeight-A.scrollTop-A.clientHeight<24;J(W)},ve=async()=>{try{await navigator.clipboard.writeText(u.map(A=>A.raw).join(` -`))}catch{}},ae=_.useMemo(()=>{const A=new Map;for(const W of u)A.set(W.level,(A.get(W.level)??0)+1);return A},[u]);return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/65 p-3 backdrop-blur-sm sm:p-6",onClick:r,children:h.jsxs("div",{ref:ie,role:"dialog","aria-modal":"true","aria-labelledby":"log-viewer-title",onKeyDown:V,className:"animate-modal-in flex h-[min(84dvh,760px)] w-[clamp(560px,85vw,1500px)] min-h-0 flex-col overflow-hidden rounded-xl border border-frame-line glass-panel sm:rounded-2xl",onClick:A=>A.stopPropagation(),children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-b border-line px-5 py-4 sm:px-6",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[h.jsx("span",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Pr,{className:"h-5 w-5 text-chip-indigo-text","aria-hidden":"true"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{id:"log-viewer-title",className:"text-base font-semibold text-ink",children:"Application logs"}),h.jsxs("p",{className:"truncate font-mono text-xs text-ink-muted",children:[d,h.jsxs("span",{className:"text-ink-faint",children:[" · ",Vx(m)]})]})]})]}),h.jsxs("div",{className:"relative min-w-[220px] flex-1",children:[h.jsx($y,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ink-faint","aria-hidden":"true"}),h.jsx("input",{ref:Q,type:"search",value:g,onChange:A=>w(A.target.value),placeholder:"Filter log lines…","aria-label":"Filter log lines",className:"w-full rounded-lg border border-line bg-elevated py-1.5 pl-8 pr-2.5 font-mono text-xs text-ink placeholder:text-ink-faint focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400"})]}),h.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[h.jsx(He,{text:T?"Pause live tail":"Resume live tail",block:!1,children:h.jsxs("button",{type:"button",onClick:()=>L(A=>!A),"aria-pressed":T,className:`flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400 ${T?"border-status-success-border bg-status-success-bg text-status-success-text":"border-line bg-elevated text-ink-muted hover:text-ink"}`,children:[h.jsx("span",{className:`h-2 w-2 rounded-full ${T?"bg-emerald-400":"bg-ink-faint"}`,"aria-hidden":"true"}),T?"Live":"Paused"]})}),h.jsx(He,{text:"Refresh now",block:!1,children:h.jsx("button",{type:"button",onClick:()=>void ne(),disabled:v,className:"rounded-lg border border-line bg-elevated p-2 text-ink-muted hover:text-ink disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(cs,{className:`h-4 w-4 ${v?"animate-spin":""}`,"aria-hidden":"true"})})}),h.jsx(He,{text:"Copy visible lines",block:!1,children:h.jsx("button",{type:"button",onClick:()=>void ve(),disabled:u.length===0,className:"rounded-lg border border-line bg-elevated p-2 text-ink-muted hover:text-ink disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(An,{className:"h-4 w-4","aria-hidden":"true"})})}),h.jsx(He,{text:"Open log file in the default application",block:!1,children:h.jsx("button",{type:"button",onClick:()=>{a==null||a(),r()},className:"rounded-lg border border-line bg-elevated p-2 text-ink-muted hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(ow,{className:"h-4 w-4","aria-hidden":"true"})})}),h.jsx(He,{text:"Close",block:!1,children:h.jsx("button",{ref:U,type:"button",onClick:r,className:"rounded-lg p-2 text-ink-muted hover:bg-hover-surface hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(nl,{className:"h-4 w-4","aria-hidden":"true"})})})]})]}),h.jsxs("div",{ref:R,onScroll:se,className:"min-h-0 flex-1 overflow-y-auto overscroll-contain bg-app px-2 py-2 font-mono text-xs leading-relaxed sm:px-3",children:[h.jsxs("div",{className:"sticky top-0 z-10 mb-1 flex items-center gap-2 rounded-md border border-line/40 bg-surface/60 px-2 py-1 text-[10px] font-bold uppercase tracking-wider text-ink-muted shadow-sm backdrop-blur-md",role:"row",children:[h.jsx("span",{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),h.jsx("span",{className:"w-[138px] shrink-0 text-ink/70",children:"Time"}),h.jsx("span",{className:"w-[52px] shrink-0 text-ink/70",children:"Level"}),h.jsx("span",{className:"w-[150px] shrink-0 text-ink/70",children:"Source"}),h.jsx("span",{className:"min-w-0 flex-1 text-ink/70",children:"Message"})]}),D&&h.jsx("p",{role:"alert",className:"px-3 py-6 text-center text-xs text-status-danger-text",children:D}),!D&&u.length===0&&!v&&h.jsx("p",{className:"px-3 py-6 text-center text-xs text-ink-faint",children:"No log entries match the current filters."}),h.jsx("ul",{className:"space-y-0.5",children:u.map((A,W)=>{const le=Fx[A.level]??Fx.UNKNOWN,re=le.icon,N=A.level==="ERROR"||A.level==="CRITICAL";return h.jsxs("li",{className:`group flex items-start gap-2 rounded px-2 py-1 ${N?"bg-status-danger-bg/40":"hover:bg-elevated/50"}`,children:[h.jsx("span",{className:le.className,children:h.jsx(re,{className:"mt-0.5 h-3.5 w-3.5","aria-hidden":"true"})}),h.jsx("span",{className:"w-[138px] shrink-0 text-ink-faint",children:A.timestamp}),h.jsx("span",{className:`w-[52px] shrink-0 text-[10px] font-semibold ${le.className}`,children:A.level}),h.jsx("span",{className:"w-[150px] shrink-0 truncate text-ink-faint",title:A.source,children:A.source}),h.jsx("span",{className:"min-w-0 flex-1 break-words text-ink-secondary",children:A.message})]},`${W}-${A.raw}`)})})]}),h.jsx("div",{className:"border-t border-line/60 bg-elevated/50 px-5 py-2.5 text-[11px] text-ink-faint shadow-sm backdrop-blur-md sm:px-6",children:h.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[h.jsx("span",{className:"mr-auto min-w-0 max-w-full basis-full truncate sm:basis-auto",role:"status","aria-atomic":"true",children:v&&u.length===0?"Loading log entries…":`${u.length} of ${Vx(m)} shown`}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"flex overflow-hidden rounded-lg border border-line/60 text-[11px] backdrop-blur-sm",role:"group","aria-label":"Filter by log level",children:_k.map(A=>{const W=x===A.value,le=A.value?ae.get(A.value)??0:u.length;return h.jsxs("button",{type:"button",onClick:()=>y(A.value),"aria-pressed":W,title:A.value?`Show ${A.value} and above`:"Show all levels",className:`flex items-center gap-1 px-2.5 py-1 font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-400 ${W?"bg-indigo-600 text-white":"text-ink-muted hover:bg-elevated hover:text-ink"}`,children:[A.label,h.jsx("span",{className:W?"text-chip-indigo-text":"text-ink-faint",children:le})]},A.label)})}),h.jsx(He,{text:"Scroll to the newest entry",block:!1,children:h.jsxs("button",{type:"button",onClick:()=>J(!0),"aria-pressed":I,className:`flex items-center gap-1.5 rounded-lg border px-2.5 py-1 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400 ${I?"border-chip-indigo-border bg-chip-indigo-bg text-chip-indigo-text":"border-line bg-elevated text-ink-muted hover:text-ink"}`,children:[h.jsx(Qy,{className:"h-3.5 w-3.5","aria-hidden":"true"}),h.jsx("span",{className:"hidden sm:inline",children:"Follow tail"})]})})]}),h.jsxs("span",{className:"hidden items-center gap-1.5 lg:flex",children:[h.jsx("span",{className:"hidden sm:inline",children:"Ctrl + Shift + L"}),h.jsx("span",{children:"opens externally"})]})]})})]})}):null}function Vx(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}const Yx='button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], video[tabindex], [tabindex]:not([tabindex="-1"])';function Wr({isOpen:n,onClose:r,dialogRef:a,initialFocusRef:u}){return _.useEffect(()=>{if(!n)return;const s=document.activeElement instanceof HTMLElement?document.activeElement:null,d=requestAnimationFrame(()=>{var p;const m=(u==null?void 0:u.current)??((p=a.current)==null?void 0:p.querySelector(Yx))??a.current;m==null||m.focus()}),f=m=>{if(m.key!=="Tab")return;const p=a.current;if(!p)return;const x=Array.from(p.querySelectorAll(Yx));if(!x.length)return;const y=x[0],g=x[x.length-1],w=document.activeElement;if(!(w instanceof Node&&p.contains(w))){m.preventDefault(),(m.shiftKey?g:y).focus();return}m.shiftKey&&(w===y||w===p)?(m.preventDefault(),g.focus()):!m.shiftKey&&(w===g||w===p)&&(m.preventDefault(),y.focus())};return window.addEventListener("keydown",f,!0),()=>{cancelAnimationFrame(d),s==null||s.focus(),window.removeEventListener("keydown",f,!0)}},[n]),s=>{s.key==="Escape"&&(s.preventDefault(),s.stopPropagation(),r())}}function zk({isOpen:n,onClose:r}){const a=_.useRef(null),u=Wr({isOpen:n,onClose:r,dialogRef:a});if(!n)return null;const s=[{key:"F5",desc:"Refresh / re-scan file list"},{key:"Ctrl + R",desc:"Reload configuration & scan"},{key:"Enter",desc:"Execute / launch selected file"},{key:"P",desc:"Open properties for selected file"},{key:"↑ / ↓",desc:"Navigate file list"},{key:"Home / End",desc:"Jump to first / last file"},{key:"PageUp / PageDown",desc:"Page through the file list"},{key:"Ctrl + D",desc:"Focus Directory field"},{key:"Ctrl + E",desc:"Focus Extension field"},{key:"Ctrl + F",desc:"Focus Filter / Search field"},{key:"Ctrl + L",desc:"Focus File List"},{key:"Ctrl + Shift + L",desc:"Open the log viewer"},{key:"Ctrl + ,",desc:"Open config file"},{key:"Ctrl + Shift + T",desc:"Toggle theme (Dark / Light)"},{key:"Ctrl + B",desc:"Toggle barcode scanner mode"},{key:"Ctrl + Shift + B",desc:"Open webcam / camera barcode scanner"},{key:"Ctrl + T",desc:"Open auto-rescan timer modal"},{key:"Ctrl + H",desc:"Set directory to home folder"},{key:"? or Ctrl + /",desc:"Show keyboard shortcuts"},{key:"Y / S / N",desc:"Answer workflow guard: Yes / Skip / No (prompt open)"},{key:"Enter",desc:"Confirm active workflow prompt (prompt open)"},{key:"Escape",desc:"Close dialogs / context menu"}];return h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",children:h.jsxs("div",{ref:a,role:"dialog","aria-modal":"true","aria-label":"Keyboard Shortcuts",onKeyDown:u,className:"animate-modal-in w-[450px] max-w-full rounded-2xl border border-frame-line glass-panel p-5",children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink",children:[h.jsx(Zy,{className:"h-5 w-5 text-chip-indigo-text"}),h.jsx("span",{children:"Keyboard Shortcuts"})]}),h.jsx("button",{onClick:r,className:"focus-ring rounded-lg p-1 text-ink-muted hover:bg-elevated hover:text-ink",children:h.jsx(nl,{className:"h-4 w-4"})})]}),h.jsx("div",{className:"max-h-[60vh] space-y-2 overflow-y-auto pr-1 text-xs",children:s.map(({key:d,desc:f})=>h.jsxs("div",{className:"flex items-center justify-between rounded-lg bg-elevated/50 px-3 py-2",children:[h.jsx("span",{className:"text-ink-secondary",children:f}),h.jsx("kbd",{className:"rounded bg-app px-2 py-0.5 font-mono text-[11px] font-semibold text-chip-indigo-text border border-line",children:d})]},d))}),h.jsx("div",{className:"mt-5 flex justify-end",children:h.jsx("button",{onClick:r,className:"btn btn-primary rounded-lg px-4 py-2 font-semibold",children:"Close"})})]})})}function Dk({isOpen:n,activeConfigPath:r,configExists:a=!0,onClose:u,onLoaded:s}){const[d,f]=_.useState(null),[m,p]=_.useState(""),[x,y]=_.useState(null),[g,w]=_.useState(!1),[v,S]=_.useState(null),T=_.useRef(null),L=_.useRef(null),D=_.useRef(null),$=a===!1;_.useEffect(()=>{var ne;if(!n){(ne=D.current)==null||ne.focus();return}D.current=document.activeElement instanceof HTMLElement?document.activeElement:null,S(null);const R=r??"",Q=Math.max(R.lastIndexOf("/"),R.lastIndexOf("\\")),fe=Q>0?R.slice(0,Q):"";I(fe);const B=requestAnimationFrame(()=>{var V;return(V=L.current)==null?void 0:V.focus()});return()=>{var V;cancelAnimationFrame(B),(V=D.current)==null||V.focus()}},[n,r]);const I=async R=>{w(!0),S(null);try{const Q=await p2(R);f(Q),p(Q.current_path),r&&Q.items.some(fe=>fe.path===r)?y(r):y(null)}catch(Q){S(Q.message||"Navigation failed")}finally{w(!1)}},J=R=>{var ne;if(R.key==="Escape"){R.preventDefault(),u();return}if(R.key!=="Tab")return;const Q=(ne=T.current)==null?void 0:ne.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(!(Q!=null&&Q.length))return;const fe=Q[0],B=Q[Q.length-1];R.shiftKey&&document.activeElement===fe?(R.preventDefault(),B.focus()):!R.shiftKey&&document.activeElement===B&&(R.preventDefault(),fe.focus())},ie=async()=>{var Q;const R=x||(((Q=d==null?void 0:d.items.find(fe=>fe.is_config))==null?void 0:Q.path)??null);if(!R){S("Select a configuration file to load.");return}try{w(!0);const fe=await f2(R);s(fe),u()}catch(fe){S(fe.message||"Unable to load configuration")}finally{w(!1)}},U=async()=>{const R=(m||(d==null?void 0:d.current_path)||"").trim();if(!R){S("Choose a directory before creating a configuration.");return}try{w(!0);const Q=await m2(R);s(Q),u()}catch(Q){S(Q.message||"Unable to create configuration")}finally{w(!1)}};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/65 p-3 backdrop-blur-sm sm:p-6",onClick:u,children:h.jsxs("div",{ref:T,role:"dialog","aria-modal":"true","aria-labelledby":"load-config-title",onKeyDown:J,className:"animate-modal-in flex h-[min(84dvh,760px)] max-h-[calc(100dvh-1.5rem)] w-[min(94vw,960px)] min-h-0 flex-col overflow-hidden rounded-xl border border-frame-line glass-panel sm:rounded-2xl",onClick:R=>R.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-line px-4 py-3 sm:px-5",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Kr,{className:"h-5 w-5 text-chip-indigo-text"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{id:"load-config-title",className:"text-sm font-semibold text-ink",children:$?"Create configuration":"Load configuration"}),h.jsx("p",{className:"truncate font-mono text-xs text-ink-muted",children:(d==null?void 0:d.current_path)||""})]})]}),h.jsx(He,{text:"Close",block:!1,children:h.jsx("button",{type:"button",onClick:u,"aria-label":"Close configuration modal",className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg text-ink-muted transition-colors hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(nl,{className:"h-4 w-4"})})})]}),$&&h.jsx("div",{className:"border-b border-line bg-chip-indigo-bg/20 px-4 py-3 text-xs text-ink-secondary",children:"No configuration file was found. Create one here?"}),h.jsxs("div",{className:"border-b border-line px-4 py-3 sm:px-5",children:[h.jsx("label",{htmlFor:"config-path-input",className:"mb-1.5 block text-xs font-medium text-ink-secondary",children:"Configuration directory"}),h.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[h.jsx("input",{ref:L,id:"config-path-input",type:"text",value:m,onChange:R=>p(R.target.value),onKeyDown:R=>{R.key==="Enter"&&I(m.trim())},placeholder:"/path/to/directory",className:"h-10 min-w-0 flex-1 rounded-lg border border-line bg-elevated px-2.5 font-mono text-sm text-ink outline-none placeholder:text-ink-faint transition-colors hover:bg-surface-strong focus-visible:border-indigo-500 focus-visible:ring-2 focus-visible:ring-indigo-500/30"}),h.jsx("button",{type:"button",onClick:()=>I(m.trim()),className:"inline-flex h-10 shrink-0 items-center gap-1.5 rounded-lg border border-line bg-elevated px-3.5 text-sm font-medium text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Go"}),h.jsx(He,{text:"Home directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>I(""),"aria-label":"Home directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Yd,{className:"h-4 w-4"})})}),(d==null?void 0:d.parent_path)&&h.jsx(He,{text:"Parent directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>I(d.parent_path),"aria-label":"Parent directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Vd,{className:"h-4 w-4 rotate-180"})})})]})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 py-2 sm:px-3 sm:py-3","aria-busy":g,children:g?h.jsxs("div",{className:"flex h-full items-center justify-center gap-2.5 text-sm text-ink-muted",children:[h.jsx(Wi,{className:"h-5 w-5 animate-spin text-chip-indigo-text"}),h.jsx("span",{role:"status",children:"Loading configuration files…"})]}):v?h.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-2.5 text-center",children:[h.jsx("p",{className:"text-sm text-status-danger-text",children:v}),h.jsx("button",{type:"button",onClick:()=>I(m||(d==null?void 0:d.current_path)||""),className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Retry"})]}):h.jsxs("ul",{className:"space-y-1",children:[d==null?void 0:d.items.map(R=>{if(R.is_dir)return h.jsx("li",{children:h.jsx("button",{onClick:()=>I(R.path),onDoubleClick:()=>I(R.path),className:"flex w-full items-center justify-between rounded-md px-3 py-1.5 text-left text-xs text-ink-secondary hover:bg-elevated",children:h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(ss,{className:"h-3.5 w-3.5 text-chip-indigo-text"}),R.name]})})},R.path);const Q=x===R.path;return h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>y(R.path),"aria-pressed":Q,className:`flex w-full items-center justify-between rounded-lg px-3 py-1.5 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-400 ${Q?"bg-chip-indigo-bg text-chip-indigo-text":"text-ink-secondary hover:bg-elevated hover:text-ink"}`,children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx(Pr,{className:"h-5 w-5 shrink-0 text-chip-amber-text"}),h.jsx("span",{className:"truncate",children:R.name})]}),R.is_config&&h.jsx(Kr,{className:"h-4 w-4 shrink-0 text-chip-indigo-text"}),Q&&h.jsx(vi,{className:"h-4 w-4 shrink-0 text-chip-indigo-text"})]})},R.path)}),(d==null?void 0:d.items.filter(R=>R.is_config).length)===0&&h.jsxs("li",{className:"flex h-full min-h-36 flex-col items-center justify-center gap-2.5 text-center text-sm text-ink-muted",children:[h.jsx(Pr,{className:"h-7 w-7 text-ink-faint"}),"No configuration files found"]})]})}),h.jsxs("div",{className:"flex flex-col gap-2 border-t border-line px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"mb-0.5 text-xs font-medium text-ink-muted",children:"Selected file"}),h.jsx("p",{className:"truncate font-mono text-sm text-ink",title:x||m,children:x||m||"—"})]}),h.jsxs("div",{className:"flex shrink-0 justify-end gap-1.5",children:[h.jsx("button",{type:"button",onClick:u,className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Cancel"}),$?h.jsxs("button",{type:"button",onClick:U,disabled:!m.trim(),className:"btn btn-primary min-h-10 rounded-lg px-4 text-sm font-semibold",children:[h.jsx(Kr,{className:"h-4 w-4"}),"Create configuration"]}):h.jsxs("button",{type:"button",onClick:ie,disabled:!x,className:"btn btn-primary min-h-10 rounded-lg px-4 text-sm font-semibold",children:[h.jsx(Kr,{className:"h-4 w-4"}),"Load configuration"]})]})]})]})}):null}function nb({isOpen:n,onClose:r,initialFilePath:a,md5:u}){const[s,d]=_.useState(null),[f,m]=_.useState(""),[p,x]=_.useState([]),[y,g]=_.useState(!1),[w,v]=_.useState(null),[S,T]=_.useState(!1),[L,D]=_.useState(!1),[$,I]=_.useState(null),J=_.useRef(null),ie=Wr({isOpen:n,onClose:r,dialogRef:J});_.useEffect(()=>{if(!n)return;async function ae(){if(a){g(!0);try{const A=await _x({filePath:a});d(A.image),m(A.content),U(A.content)}catch(A){v(A.message)}finally{g(!1)}}}ae()},[n,a]);const U=ae=>{const A=ae.split(";").map(W=>{const le=W.split("=");return{key:le[0]||"",value:le[1]||""}}).filter(W=>W.key||W.value);x(A)},R=async ae=>{const A=ae.filter(W=>W.key.trim()).map(W=>`${W.key.trim()}=${W.value.trim()}`).join(";");if(m(A),!A){d(null);return}try{const W=await _x({content:A});d(W.image)}catch(W){console.error("Failed to re-generate barcode:",W)}},Q=(ae,A,W)=>{const le=[...p];le[ae][A]=W,x(le),R(le)},fe=()=>{const ae=[...p,{key:"",value:""}];x(ae)},B=ae=>{const A=p.filter((W,le)=>le!==ae);x(A),R(A)},ne=()=>{if(!u||p.some(A=>A.key.toLowerCase()==="md5"))return;const ae=[...p,{key:"md5",value:u}];x(ae),R(ae)},V=async()=>{if(s){I("Saving…");try{const ae=await w2(s,`profiles-qr-${Date.now()}.png`);I(ae.path||ae.message)}catch(ae){I(`Save failed: ${(ae==null?void 0:ae.message)??ae}`)}finally{setTimeout(()=>I(null),6e3)}}},se=async()=>{try{await navigator.clipboard.writeText(f),T(!0),setTimeout(()=>T(!1),2e3)}catch(ae){console.error("Copy failed",ae)}},ve=async()=>{if(s)try{const A=await(await fetch(s)).blob();await navigator.clipboard.write([new ClipboardItem({[A.type]:A})]),D(!0),setTimeout(()=>D(!1),2e3)}catch(ae){console.error("Image copy failed",ae)}};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4",onClick:r,children:h.jsxs("div",{ref:J,role:"dialog","aria-modal":"true","aria-label":"QR Code Settings",onKeyDown:ie,className:"animate-modal-in w-full max-w-md rounded-xl border border-frame-line glass-panel p-6",onClick:ae=>ae.stopPropagation(),children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[h.jsx("h3",{className:"text-sm font-semibold text-ink",children:"QR Code Settings"}),h.jsx("button",{onClick:r,className:"focus-ring rounded-md p-1 text-ink-muted hover:bg-elevated hover:text-ink",children:h.jsx(nl,{className:"h-4 w-4"})})]}),y?h.jsx("div",{className:"flex h-48 items-center justify-center",children:h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-600 border-t-transparent"})}):w?h.jsx("div",{className:"rounded-md border border-status-danger-border bg-status-danger-bg p-4 text-center text-xs text-status-danger-text",children:w}):h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-col items-center gap-4",children:[h.jsxs("div",{className:"relative group",children:[h.jsx("div",{className:"h-48 w-48 overflow-hidden rounded-lg border border-line bg-white p-2",children:s?h.jsx("img",{src:s,alt:"QR Code",className:"h-full w-full object-contain"}):h.jsx("div",{className:"flex h-full items-center justify-center text-xs text-slate-400",children:"No content"})}),s&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-black/20 rounded-lg",children:h.jsxs("button",{onClick:ve,className:"focus-ring flex items-center gap-2 rounded-md bg-white/90 p-2 text-xs font-medium text-slate-900 shadow-sm hover:bg-white",children:[L?h.jsx(vi,{className:"h-3.5 w-3.5"}):h.jsx(An,{className:"h-3.5 w-3.5"}),L?"Copied":"Copy Image"]})})]}),h.jsxs("div",{className:"flex w-full gap-2",children:[h.jsxs("button",{onClick:se,className:"btn btn-secondary flex-1 px-3 py-1.5",children:[S?h.jsx(vi,{className:"h-3.5 w-3.5 text-status-success-text"}):h.jsx(An,{className:"h-3.5 w-3.5"}),"Copy Content"]}),h.jsxs("button",{onClick:V,disabled:!s,className:"btn btn-primary flex-1 px-3 py-1.5",children:[h.jsx(Iy,{className:"h-3.5 w-3.5"}),"Save Image"]})]}),$&&h.jsx("p",{className:"break-all text-center text-[11px] text-ink-muted",role:"status",children:$})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("label",{className:"text-xs font-medium text-ink-muted uppercase tracking-wider",children:"Payload Fields"}),h.jsxs("div",{className:"flex gap-2",children:[u&&!p.some(ae=>ae.key==="md5")&&h.jsxs("button",{onClick:ne,className:"btn-chip flex items-center gap-1 rounded px-2 py-0.5 text-[10px] font-bold text-chip-purple-text border border-chip-purple-border",children:[h.jsx(Zr,{className:"h-3 w-3"})," Inc. MD5"]}),h.jsxs("button",{onClick:fe,className:"btn-chip flex items-center gap-1 rounded px-2 py-0.5 text-[10px] font-bold text-chip-indigo-text border border-chip-indigo-border",children:[h.jsx(Uw,{className:"h-3 w-3"})," Add Field"]})]})]}),h.jsxs("div",{className:"max-h-48 space-y-2 overflow-y-auto pr-1 custom-scrollbar",children:[p.map((ae,A)=>h.jsxs("div",{className:"flex gap-2 items-center slide-in",children:[h.jsx("input",{type:"text",placeholder:"key",value:ae.key,onChange:W=>Q(A,"key",W.target.value),className:"w-1/3 rounded border border-line bg-elevated px-2 py-1 text-xs text-ink focus:border-indigo-500 focus:outline-none"}),h.jsx("input",{type:"text",placeholder:"value",value:ae.value,onChange:W=>Q(A,"value",W.target.value),className:"flex-1 rounded border border-line bg-elevated px-2 py-1 text-xs text-ink focus:border-indigo-500 focus:outline-none"}),h.jsx("button",{onClick:()=>B(A),className:"p-1 text-ink-muted hover:text-status-danger-text transition-colors","aria-label":"Remove field",children:h.jsx(Py,{className:"h-3.5 w-3.5"})})]},A)),p.length===0&&h.jsx("p",{className:"text-center py-4 text-xs text-ink-muted italic",children:"No fields defined"})]})]}),h.jsxs("div",{className:"pt-2 border-t border-line",children:[h.jsx("label",{className:"text-[10px] font-medium text-ink-muted uppercase tracking-wider block mb-1.5",children:"Raw Preview"}),h.jsx("div",{className:"rounded bg-elevated p-2 font-mono text-[10px] text-ink-secondary break-all border border-line",children:f||h.jsx("span",{className:"italic text-ink-muted/50",children:"empty"})})]})]})]})}):null}const Gx=["Bytes","KB","MB","GB","TB"];function lb(n){if(n===0)return"0 Bytes";const r=1024,a=Math.max(0,Math.min(Gx.length-1,Math.floor(Math.log(n)/Math.log(r))));return parseFloat((n/Math.pow(r,a)).toFixed(2))+" "+Gx[a]}function Mk(n){const r=Math.max(n.lastIndexOf("\\"),n.lastIndexOf("/"));return r===-1?"":n.slice(0,r)}function Ok(n){const r=[`File Properties: ${n.name}`,`Path: ${n.path}`,`Type: ${n.type}`,`Size: ${lb(n.size_bytes)}`,`Created: ${n.created}`,`Modified: ${n.modified}`];return n.md5&&r.push(`MD5: ${n.md5}`),n.sha256&&r.push(`SHA256: ${n.sha256}`),r.join(` -`)}function td(n,r,a){return n.length<=r+a+1?n:`${n.slice(0,r)}…${n.slice(-a)}`}function Rk(n){const r=n.includes("\\")?"\\":"/",a=n.split(/[\\/]/);return a.length<=5?n:[a[0],a[1],"…",a[a.length-2],a[a.length-1]].join(r)}const Lk=[{ms:1e3*60,unit:"minute"},{ms:1e3*60*60,unit:"hour"},{ms:1e3*60*60*24,unit:"day"},{ms:1e3*60*60*24*30,unit:"month"},{ms:1e3*60*60*24*365,unit:"year"}];function Qx(n,r=new Date){const a=new Date(n.replace(" ","T"));if(Number.isNaN(a.getTime()))return"just now";const u=r.getTime()-a.getTime();if(u<6e4)return"just now";let s="just now";for(const{ms:d,unit:f}of Lk){if(u{var V;n||((V=I.current)==null||V.focus(),v(!1))},[n]),_.useEffect(()=>{if(!n||!r)return;const V=new AbortController;return J.current=V,d(null),D(null),m(!0),x(null),(async()=>{try{const se=await b2(r.path,V.signal);if(J.current!==V)return;d(se)}catch(se){if(J.current!==V||se instanceof DOMException&&se.name==="AbortError")return;x(se instanceof Error?se.message:"Failed to load properties")}finally{J.current===V&&m(!1)}})(),()=>{J.current=null,V.abort()}},[n,r]),_.useEffect(()=>{if(!n)return;const V=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=V}},[n]),_.useEffect(()=>{if(!n)return;const V=se=>{if(se.key==="Escape"){if(w)return;a();return}if(se.key!=="Tab")return;const ve=$.current;if(!ve)return;const ae=Array.from(ve.querySelectorAll('button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(re=>re.offsetParent!==null);if(ae.length===0)return;const A=ae[0],W=ae[ae.length-1],le=document.activeElement instanceof HTMLElement?document.activeElement:null;se.shiftKey?(le===A||!ve.contains(le))&&(se.preventDefault(),W.focus()):le===W&&(se.preventDefault(),A.focus())};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[n,w,a]),_.useEffect(()=>{if(!n)return;const V=document.activeElement instanceof HTMLElement?document.activeElement:null;I.current=V;const se=requestAnimationFrame(()=>{var ve,ae;(ae=(ve=$.current)==null?void 0:ve.querySelector("button"))==null||ae.focus()});return()=>cancelAnimationFrame(se)},[n]);const ie=async(V,se)=>{try{await navigator.clipboard.writeText(V),g(se),setTimeout(()=>g(null),2e3)}catch(ve){console.error("Failed to copy:",ve)}},U=async(V,se,ve)=>{T(V),D(null);try{await ve(),D(se)}catch{D("Action failed")}finally{T(null)}},R=V=>`btn btn-chip rounded-md border px-3 py-2 text-xs ${{reveal:"bg-chip-sky-bg text-chip-sky-text border-chip-sky-border",launch:"border-emerald-500/30 bg-emerald-600 font-semibold text-white hover:bg-emerald-500",folder:"bg-chip-amber-bg text-chip-amber-text border-chip-amber-border"}[V]??"bg-chip-indigo-bg text-chip-indigo-text border-chip-indigo-border"}`,Q=(V,se,ve,ae=!1,A)=>h.jsxs("div",{className:"flex items-start gap-2 py-1.5 group",children:[h.jsxs("span",{className:"text-ink-muted min-w-[100px] text-xs",children:[V,":"]}),h.jsx("div",{className:"flex-1 min-w-0",children:h.jsx("span",{className:`text-ink text-xs break-all ${ae?"font-mono":""}`,children:A??se})}),h.jsx(He,{text:"Copy to clipboard",block:!1,children:h.jsx("button",{onClick:()=>ie(se,ve),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-elevated","aria-label":`Copy ${V}`,children:y===ve?h.jsx(vi,{className:"h-3.5 w-3.5 text-status-success-text"}):h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted"})})})]}),fe=(V,se,ve)=>h.jsxs("div",{className:"rounded-lg border border-line bg-elevated p-4",children:[h.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[se,h.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-ink-muted",children:V})]}),ve]}),B=()=>h.jsx(He,{text:"Click to copy full path",children:h.jsxs("button",{onClick:()=>void ie(s.path,"path"),className:"group mb-3 flex w-full items-center gap-2 rounded-lg border border-line bg-elevated px-3 py-2 text-left hover:bg-surface",children:[h.jsx(ss,{className:"text-chip-amber-text h-4 w-4 flex-shrink-0"}),h.jsx("span",{className:"text-ink min-w-0 flex-1 truncate font-mono text-xs",children:Rk(s.path)}),y==="path"?h.jsx(vi,{className:"text-status-success-text h-3.5 w-3.5"}):h.jsx(An,{className:"text-ink-muted h-3.5 w-3.5"})]})});if(!n||!r)return null;const ne=r;return h.jsxs("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 backdrop-blur-md p-4",role:"dialog","aria-modal":"true","aria-labelledby":"properties-modal-title",children:[h.jsx("div",{className:"absolute inset-0",onClick:a,onContextMenu:V=>{V.preventDefault(),a()}}),h.jsxs("div",{ref:$,className:"animate-modal-in relative w-full max-w-4xl max-h-[90vh] overflow-hidden rounded-xl border border-frame-line glass-panel flex flex-col",children:[h.jsx("div",{className:"flex-shrink-0 border-b border-line px-6 py-4",children:h.jsxs("div",{className:"flex items-start justify-between gap-4",children:[h.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[h.jsx("div",{className:"rounded-lg bg-indigo-600 p-2 flex-shrink-0",children:h.jsx(Wf,{className:"h-5 w-5 text-white"})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("h3",{id:"properties-modal-title",className:"text-base font-semibold text-ink truncate",children:"File Properties"}),h.jsx("p",{className:"text-xs text-ink-muted truncate",children:r.filename})]}),h.jsx(He,{text:"Copy all properties to clipboard",block:!1,children:h.jsx("button",{onClick:()=>{s&&ie(Ok(s),"all")},disabled:!s||f||p!==null,className:"btn-chip ml-2 flex items-center gap-1 rounded-md border border-chip-indigo-border bg-chip-indigo-bg p-1.5 text-chip-indigo-text","aria-label":"Copy all properties",children:y==="all"?h.jsx(vi,{className:"h-4 w-4 text-status-success-text"}):h.jsx(An,{className:"h-4 w-4"})})}),h.jsx(He,{text:"Generate Barcode/QR Code",block:!1,children:h.jsx("button",{onClick:()=>v(!0),className:"btn-chip rounded-md border border-chip-indigo-border bg-chip-indigo-bg p-1.5 text-chip-indigo-text",children:h.jsx(Gd,{className:"h-4 w-4"})})})]}),h.jsx("button",{onClick:a,className:"focus-ring rounded-md p-1 text-ink-muted hover:bg-elevated hover:text-ink flex-shrink-0","aria-label":"Close",children:h.jsx(nl,{className:"h-4 w-4"})})]})}),h.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:[f&&h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsxs("div",{className:"flex flex-col items-center gap-2",children:[h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-600 border-t-transparent"}),h.jsx("p",{className:"text-xs text-ink-muted",children:"Loading properties..."})]})}),p&&h.jsx("div",{className:"rounded-lg border border-status-danger-border bg-status-danger-bg p-4 text-center",children:h.jsx("p",{className:"text-xs text-status-danger-text",children:p})}),s&&!f&&!p&&h.jsxs("div",{children:[h.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-x-4 gap-y-1.5 rounded-lg border border-line bg-elevated px-4 py-2.5",children:[h.jsx("span",{className:"inline-flex items-center gap-1 rounded-md border border-chip-indigo-border bg-chip-indigo-bg px-2 py-0.5 text-xs font-semibold text-chip-indigo-text",children:s.type}),s.attributes.extension&&h.jsx("span",{className:"inline-flex items-center rounded-md border border-line bg-surface px-2 py-0.5 text-xs font-medium text-ink-muted",children:s.attributes.extension}),h.jsxs("span",{className:"text-xs text-ink-muted",title:`${s.size_bytes} bytes`,children:["Size ",h.jsx("strong",{className:"text-ink font-medium",children:lb(s.size_bytes)})]}),h.jsxs("span",{className:"text-xs text-ink-muted",title:s.created,children:["Created ",h.jsx("strong",{className:"text-ink font-medium",children:Qx(s.created)})]}),h.jsxs("span",{className:"text-xs text-ink-muted",title:s.modified,children:["Modified ",h.jsx("strong",{className:"text-ink font-medium",children:Qx(s.modified)})]}),s.md5&&h.jsx("span",{className:"inline-flex items-center rounded-md border border-chip-purple-border bg-chip-purple-bg px-2 py-0.5 font-mono text-xs font-medium text-chip-purple-text",title:`MD5 ${s.md5}`,children:td(s.md5,4,4)}),s.attributes.is_symlink&&h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-chip-fuchsia-border bg-chip-fuchsia-bg px-2 py-0.5 text-xs font-medium text-chip-fuchsia-text",children:[h.jsx(Cw,{className:"h-3 w-3"})," Symlink"]})]}),B(),h.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[fe("Hashes",h.jsx(Zr,{className:"text-chip-purple-text h-3.5 w-3.5"}),h.jsxs("div",{className:"space-y-0.5",children:[Q("MD5",s.md5,"md5",!0,td(s.md5,10,6)),Q("SHA256",s.sha256,"sha256",!0,td(s.sha256,10,6))]})),fe("Timestamps",h.jsx(G2,{className:"text-chip-sky-text h-3.5 w-3.5"}),h.jsxs("div",{className:"space-y-0.5",children:[Q("Created",s.created,"created",!0),Q("Modified",s.modified,"modified",!0)]})),fe("Identity",h.jsx(Wf,{className:"text-chip-indigo-text h-3.5 w-3.5"}),h.jsxs("div",{className:"space-y-0.5",children:[Q("Type",s.type,"type"),s.attributes.stem&&Q("Stem",s.attributes.stem,"attrStem"),Q("Extension",s.name.includes(".")?s.name.slice(s.name.lastIndexOf(".")):"None","extension"),Q("Directory",Mk(s.path)||"None","directory",!0)]})),fe("System",h.jsx(Wf,{className:"text-status-success-text h-3.5 w-3.5"}),h.jsxs("div",{children:[h.jsxs("div",{className:"mb-1 flex min-h-[24px] flex-wrap items-center gap-1.5",children:[s.attributes.is_readonly&&h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-status-danger-border bg-status-danger-bg px-2 py-0.5 text-xs text-status-danger-text",children:[h.jsx(Aw,{className:"h-3 w-3"})," Read-only"]}),s.attributes.is_hidden&&h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-slate-500/30 bg-slate-600/20 px-2 py-0.5 text-xs text-slate-300",children:[h.jsx(cw,{className:"h-3 w-3"})," Hidden"]}),!s.attributes.is_readonly&&!s.attributes.is_hidden&&!s.attributes.is_symlink&&h.jsx("span",{className:"text-xs text-ink-muted",children:"No special flags"})]}),h.jsxs("div",{className:"space-y-0.5",children:[Q("File Type",s.attributes.is_file?"Regular File":s.attributes.is_dir?"Directory":"Other","fileType"),s.attributes.permissions&&Q("Permissions",s.attributes.permissions,"permissions",!0),s.attributes.owner_uid!==void 0&&Q("Owner UID",String(s.attributes.owner_uid),"ownerUid"),s.attributes.group_gid!==void 0&&Q("Group GID",String(s.attributes.group_gid),"groupGid")]})]}))]})]})]}),h.jsx("div",{className:"flex-shrink-0 border-t border-line px-6 py-3",children:h.jsxs("div",{className:"flex justify-between items-center gap-2",children:[h.jsx("p",{className:"min-w-0 text-xs text-ink-muted truncate",children:L??"Click the copy icon next to any field to copy its value"}),h.jsxs("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[h.jsx(He,{text:"Show file in Explorer",block:!1,children:h.jsxs("button",{onClick:()=>void U("reveal","Revealed in Explorer",()=>Yy(ne.path)),disabled:S!==null,className:R("reveal"),children:[h.jsx(vd,{className:"h-3.5 w-3.5"})," Reveal"]})}),h.jsx(He,{text:"Launch file with default association",block:!1,children:h.jsxs("button",{onClick:()=>{u&&(T("launch"),Promise.resolve(u(ne)).finally(()=>T(null)))},disabled:S!==null||!u,className:R("launch"),children:[h.jsx(er,{className:"h-3.5 w-3.5"})," Launch"]})}),h.jsx(He,{text:"Open containing folder",block:!1,children:h.jsxs("button",{onClick:()=>void U("folder","Opened folder",()=>yd(ne.path)),disabled:S!==null,className:R("folder"),children:[h.jsx(Ji,{className:"h-3.5 w-3.5"})," Open Folder"]})}),h.jsx("button",{onClick:a,className:"btn btn-primary px-4 py-2",children:"Close"})]})]})})]}),h.jsx(nb,{isOpen:w,onClose:()=>v(!1),initialFilePath:r.path,md5:s==null?void 0:s.md5})]})}const Bk=["qr_code","code_128","code_39","ean_13","ean_8","upc_a","upc_e","data_matrix"],Hk=250,qk=400,Fk=.7;function Vk(n,r=qk,a=Fk){const u=n.videoWidth,s=n.videoHeight;if(!u||!s)return null;const d=Math.min(u,s),f=document.createElement("canvas");f.width=Math.min(r,d),f.height=f.width;const m=f.getContext("2d");if(!m)return null;m.drawImage(n,(u-d)/2,(s-d)/2,d,d,0,0,f.width,f.height);const p=f.toDataURL("image/jpeg",a);return p.slice(p.indexOf(",")+1)}function Yk(n,r){const a=n.intervalMs??Hk;let u=!1,s=!1;const d=()=>{u=!0,clearInterval(f)},f=setInterval(()=>{if(u||s)return;const m=n.capture();m&&(s=!0,n.decode(m).then(p=>{u||p.decoded&&(d(),r.onDetected(p.decoded))}).catch(p=>{u||(d(),r.onError(p instanceof Error?p.message:"Frame decoding failed"))}).finally(()=>{s=!1}))},a);return d}const Gk=8e3;function Qk({isOpen:n,onClose:r,onDetected:a}){const u=_.useRef(null),s=_.useRef(null),d=Wr({isOpen:n,onClose:r,dialogRef:s}),f=_.useRef(null),m=_.useRef(null),p=_.useRef(null),[x,y]=_.useState(null),[g,w]=_.useState(!1),v=()=>{p.current&&(p.current(),p.current=null),m.current&&(cancelAnimationFrame(m.current),m.current=null),f.current&&(f.current.getTracks().forEach(L=>L.stop()),f.current=null),u.current&&(u.current.srcObject=null)};_.useEffect(()=>{if(!n){v(),y(null);return}let L=!0;async function D(){var I,J,ie,U,R;if(y(null),w(!1),typeof window<"u"&&!window.isSecureContext&&window.location.hostname!=="localhost"&&window.location.hostname!=="127.0.0.1"){y("Camera access requires HTTPS or localhost. If connecting across a local network IP (e.g. 192.168.x.x), modern browsers disable camera access for insecure HTTP.");return}const $=((J=(I=navigator.mediaDevices)==null?void 0:I.getUserMedia)==null?void 0:J.bind(navigator.mediaDevices))||((ie=navigator.getUserMedia)==null?void 0:ie.bind(navigator))||((U=navigator.webkitGetUserMedia)==null?void 0:U.bind(navigator))||((R=navigator.mozGetUserMedia)==null?void 0:R.bind(navigator));if(!$){y(window.isSecureContext?"Camera access is not supported by your browser or environment.":"Camera access is blocked because the page is not served over a secure origin (HTTPS or localhost/127.0.0.1).");return}try{let Q;const fe=await Promise.race([$({video:{facingMode:"environment",width:{ideal:1280},height:{ideal:720}}}),new Promise((B,ne)=>{Q=window.setTimeout(()=>ne(new DOMException("Camera did not start in time","TimeoutError")),Gk)})]).finally(()=>{Q!==void 0&&window.clearTimeout(Q)});if(!L){fe.getTracks().forEach(B=>B.stop());return}f.current=fe,u.current&&(u.current.srcObject=fe,await u.current.play()),"BarcodeDetector"in window?T():S()}catch(Q){if(!L)return;console.error("Camera access error:",Q),y(Q.name==="NotAllowedError"||Q.name==="PermissionDeniedError"?"Camera permission denied. Please allow camera access in your browser settings.":Q.name==="TimeoutError"?"The camera did not start in time. On macOS, camera capture needs the packaged desktop app — a bare Python process cannot access the camera. Alternatively, open ProFiles in Chrome, Edge or Safari.":`Could not access camera: ${Q.message||"Unknown error"}`)}}return D(),()=>{L=!1,v()}},[n]);const S=()=>{w(!0),p.current=Yk({capture:()=>u.current?Vk(u.current):null,decode:L=>y2({imageBase64:L,formats:[...Bk]})},{onDetected:L=>{v(),a(L)},onError:L=>{v(),y(L)}})},T=()=>{const L=["qr_code","code_128","code_39","ean_13","ean_8","upc_a","upc_e","data_matrix"];let D;try{D=new window.BarcodeDetector({formats:L})}catch(I){console.warn("BarcodeDetector formats unsupported:",I),D=new window.BarcodeDetector}const $=async()=>{if(!u.current||u.current.readyState<2){m.current=requestAnimationFrame($);return}try{const I=await D.detect(u.current);if(I&&I.length>0){const J=I[0].rawValue;if(J){v(),a(J);return}}}catch(I){console.debug("Frame detection error:",I)}m.current=requestAnimationFrame($)};m.current=requestAnimationFrame($)};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/70 p-4 backdrop-blur-sm",onClick:r,children:h.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-label":"Camera barcode scanner",onKeyDown:d,className:"relative w-full max-w-lg rounded-2xl border border-frame-line glass-panel p-6 flex flex-col",onClick:L=>L.stopPropagation(),children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink",children:[h.jsx(Xy,{className:"h-5 w-5 text-chip-indigo-text"}),h.jsx("span",{children:"Scan with Camera"})]}),h.jsx("button",{onClick:r,className:"focus-ring rounded-lg p-1 text-ink-muted hover:bg-elevated hover:text-ink transition-colors","aria-label":"Close",children:h.jsx(nl,{className:"h-4 w-4"})})]}),x?h.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[h.jsx("div",{className:"rounded-full bg-status-danger-bg p-3 text-status-danger-text mb-3",children:h.jsx(lu,{className:"h-6 w-6"})}),h.jsx("p",{className:"text-xs text-status-danger-text max-w-xs",children:x}),h.jsx("button",{onClick:r,className:"btn btn-secondary mt-6 px-4 py-2",children:"Close"})]}):h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsxs("div",{className:"relative aspect-video w-full overflow-hidden rounded-xl bg-black border border-line flex items-center justify-center",children:[h.jsx("video",{ref:u,playsInline:!0,muted:!0,className:"h-full w-full object-cover"}),h.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:h.jsxs("div",{className:"relative h-48 w-48 rounded-lg border-2 border-dashed border-indigo-400/80 bg-indigo-500/5 shadow-[0_0_0_9999px_rgba(0,0,0,0.45)]",children:[h.jsx("div",{className:"absolute top-0 left-0 h-4 w-4 border-t-2 border-l-2 border-indigo-400"}),h.jsx("div",{className:"absolute top-0 right-0 h-4 w-4 border-t-2 border-r-2 border-indigo-400"}),h.jsx("div",{className:"absolute bottom-0 left-0 h-4 w-4 border-b-2 border-l-2 border-indigo-400"}),h.jsx("div",{className:"absolute bottom-0 right-0 h-4 w-4 border-b-2 border-r-2 border-indigo-400"})]})})]}),h.jsx("p",{className:"mt-4 text-center text-xs text-ink-muted",children:g?"Hold a QR code or barcode steady in front of your camera — frames are decoded by the local ProFiles server (no native Barcode Detector in this browser).":"Hold a QR code or barcode steady in front of your camera to auto-scan."})]})]})}):null}function Xk({isOpen:n,file:r,onConfirm:a,onDismiss:u}){const s=_.useRef(null);return _.useEffect(()=>{var d;if(n){const f=m=>{m.key==="Enter"?(m.preventDefault(),a()):m.key==="Escape"&&(m.preventDefault(),u())};return window.addEventListener("keydown",f),(d=s.current)==null||d.focus(),()=>window.removeEventListener("keydown",f)}},[n,a,u]),!n||!r?null:h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",onClick:u,children:h.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":`1 file matched: ${r.filename}`,className:"animate-modal-in w-full max-w-sm rounded-xl border border-frame-line glass-panel p-5 flex flex-col gap-4",onClick:d=>d.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink text-sm",children:[r.has_hook?h.jsx(tk,{className:"h-4 w-4 text-chip-purple-text"}):h.jsx(er,{className:"h-4 w-4 text-status-success-text"}),h.jsx("span",{children:"1 File Matched"})]}),h.jsx("button",{onClick:u,className:"focus-ring rounded p-1 text-ink-muted hover:bg-elevated hover:text-ink","aria-label":"Dismiss",children:h.jsx(nl,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-line bg-elevated/50 p-3",children:[h.jsx(Pr,{className:"h-5 w-5 text-chip-indigo-text shrink-0 mt-0.5"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("h4",{className:"text-xs font-semibold text-ink truncate",children:r.filename}),h.jsx("p",{className:"text-[11px] text-ink-muted truncate mt-0.5",children:r.rel_path||r.path}),r.has_hook&&h.jsx("span",{className:"inline-block mt-1 text-[10px] text-chip-purple-text bg-chip-purple-bg px-1.5 py-0.5 rounded border border-chip-purple-border/50 font-medium",children:"Workflow Hook Configured"})]})]}),h.jsx("p",{className:"text-xs text-ink-muted text-center",children:"Launch this file now?"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{type:"button",onClick:u,className:"btn btn-secondary flex-1 px-3 py-1.5",children:"Dismiss (Esc)"}),h.jsxs("button",{ref:s,type:"button",onClick:a,className:"btn btn-primary flex-1 px-3 py-1.5 shadow-md",children:[h.jsx(er,{className:"h-3 w-3 fill-current"}),"Launch (Enter)"]})]})]})})}function Ik({systemInfo:n,fileCount:r,theme:a,onToggleTheme:u,onOpenLog:s,onOpenConfig:d,onLoadConfig:f,onShowShortcuts:m,onReloadConfig:p,onExport:x,exportDisabled:y=!1,language:g="en",onLanguageChange:w,activeConfigName:v,lanEnabled:S,onToggleLan:T}){return h.jsxs("footer",{className:"flex items-center justify-between border-t border-line bg-app px-4 py-2 text-[11px] text-ink-muted transition-colors duration-200",children:[h.jsx("div",{className:"flex items-center gap-4",children:n&&h.jsxs("div",{className:"flex items-center gap-1.5 rounded-full border border-line bg-surface px-2.5 py-0.5 text-ink-secondary",children:[h.jsx(D2,{className:"h-3 w-3 text-status-success-text"}),h.jsx("a",{href:`http://${n.hostname}:${window.location.port}`,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ProFiles on ${n.hostname}`,className:"font-mono hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 rounded px-1 py-0.5",children:n.hostname}),h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsx("a",{href:`http://${n.ip}:${window.location.port}`,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ProFiles on ${n.ip}`,className:"font-mono hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 rounded px-1 py-0.5",children:n.ip}),h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsxs("span",{className:"flex items-center gap-1",title:"Session user",children:[h.jsx(Pw,{className:"h-3 w-3 text-ink-faint"}),h.jsx("span",{children:n.username||"operator"})]}),T!==void 0&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsx(He,{text:"LAN access",block:!1,children:h.jsxs("button",{onClick:()=>T(S!==!0),disabled:S===null,"aria-pressed":S===!0,className:`focus-ring flex items-center gap-1 rounded px-1 py-0.5 text-[10px] ${S===null?"text-ink-faint cursor-not-allowed":S===!0?"text-status-success-text":"text-ink-muted hover:text-ink"}`,children:[h.jsx(Ow,{className:"h-3 w-3"}),h.jsx("span",{children:"LAN"})]})})]})]})}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("span",{children:[h.jsx("strong",{className:"text-ink",children:r})," files found"]}),h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsx(He,{text:"Keyboard shortcuts (?)",block:!1,children:h.jsxs("button",{onClick:m,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Zy,{className:"h-3 w-3"}),h.jsx("span",{children:"Shortcuts"})]})}),h.jsx(He,{text:"Open the application log viewer",block:!1,children:h.jsxs("button",{onClick:s,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Pr,{className:"h-3 w-3"}),h.jsx("span",{children:"Logs"})]})}),h.jsx("span",{className:"text-ink-faint",children:"|"}),p&&h.jsx(He,{text:"Reload configuration from disk",block:!1,children:h.jsxs("button",{onClick:p,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(cs,{className:"h-3 w-3"}),h.jsx("span",{children:"Reload"})]})}),x&&h.jsx(He,{text:"Export the current results as CSV",block:!1,children:h.jsxs("button",{onClick:x,disabled:y,className:"focus-ring flex items-center gap-1 rounded text-ink-muted hover:text-ink disabled:opacity-40 disabled:hover:text-ink-muted",children:[h.jsx(Iy,{className:"h-3 w-3"}),h.jsx("span",{children:"Export CSV"})]})}),w&&h.jsxs("div",{className:"flex items-center overflow-hidden rounded border border-line text-[10px]",children:[h.jsx(He,{text:"English",block:!1,children:h.jsxs("button",{onClick:()=>w("en"),className:`flex items-center gap-1 px-1.5 py-0.5 transition-colors ${g==="en"?"bg-indigo-600 text-white focus-ring":"text-ink-muted hover:text-ink focus-ring"}`,children:[h.jsx(ww,{className:"h-3 w-3"}),h.jsx("span",{children:"EN"})]})}),h.jsx(He,{text:"Français",block:!1,children:h.jsx("button",{onClick:()=>w("fr"),className:`flex items-center gap-1 px-1.5 py-0.5 transition-colors ${g==="fr"?"bg-indigo-600 text-white focus-ring":"text-ink-muted hover:text-ink focus-ring"}`,children:h.jsx("span",{children:"FR"})})})]}),f&&h.jsx(He,{text:v?`Load a different .profiles file (active: ${v})`:"Load a .profiles file",block:!1,children:h.jsxs("button",{onClick:f,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Kr,{className:"h-3 w-3"}),h.jsx("span",{children:"Load config…"})]})}),h.jsx(He,{text:"Open configuration file",block:!1,children:h.jsxs("button",{onClick:d,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Gw,{className:"h-3 w-3"}),h.jsx("span",{children:"Config"})]})}),h.jsx(He,{text:`Switch to ${a==="dark"?"light":"dark"} mode`,block:!1,children:h.jsxs("button",{onClick:u,className:"focus-ring flex items-center gap-1 rounded px-1.5 py-0.5 text-ink-muted hover:bg-elevated hover:text-status-warning-text",children:[a==="dark"?h.jsx(Xw,{className:"h-3 w-3 text-status-warning-text"}):h.jsx(Dw,{className:"h-3 w-3 text-chip-indigo-text"}),h.jsx("span",{children:a==="dark"?"Light":"Dark"})]})})]})]})}const Kk=[{label:"5 seconds",seconds:5},{label:"10 seconds",seconds:10},{label:"30 seconds",seconds:30},{label:"1 minute",seconds:60},{label:"5 minutes",seconds:300}];function Zk({isOpen:n,currentInterval:r,onClose:a,onSetInterval:u}){const s=_.useRef(null),d=Wr({isOpen:n,onClose:a,dialogRef:s});if(!n)return null;const f=r>0,m=y=>{u(y)},p=y=>{y.preventDefault();const w=y.currentTarget.elements.namedItem("custom-interval"),v=parseInt(w.value,10);!isNaN(v)&&v>0&&u(v)},x=()=>{u(0)};return h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",children:h.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-label":"Auto-Rescan Timer",onKeyDown:d,className:"animate-modal-in w-[420px] max-w-full rounded-2xl border border-frame-line glass-panel p-5",children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink",children:[h.jsx(Jy,{className:"h-5 w-5 text-chip-indigo-text"}),h.jsx("span",{children:"Auto-Rescan Timer"})]}),h.jsx("button",{onClick:a,className:"focus-ring rounded-lg p-1 text-ink-muted hover:bg-elevated hover:text-ink",children:h.jsx(nl,{className:"h-4 w-4"})})]}),h.jsx("div",{className:"mb-4 rounded-lg bg-elevated/50 px-3 py-2 text-xs",children:f?h.jsxs("div",{className:"flex items-center gap-2 text-status-success-text",children:[h.jsx(tw,{className:"h-4 w-4 animate-pulse"}),h.jsxs("span",{children:["Auto-rescan every ",r,"s"]})]}):h.jsxs("div",{className:"flex items-center gap-2 text-ink-secondary",children:[h.jsx(W2,{className:"h-4 w-4"}),h.jsx("span",{children:"Auto-rescan is disabled"})]})}),h.jsxs("div",{className:"mb-4 space-y-1 text-xs",children:[h.jsx("p",{className:"text-ink-muted",children:"Presets:"}),h.jsx("div",{className:"grid grid-cols-2 gap-2",children:Kk.map(y=>h.jsx("button",{onClick:()=>m(y.seconds),className:"rounded-lg border border-line bg-elevated/50 px-3 py-1.5 text-left font-medium text-ink-secondary hover:border-chip-indigo-border hover:bg-chip-indigo-bg/40 hover:text-chip-indigo-text focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:y.label},y.seconds))})]}),h.jsxs("form",{onSubmit:p,className:"mb-4",children:[h.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-ink-secondary",children:[h.jsx(iw,{className:"h-3.5 w-3.5"}),h.jsx("span",{children:"Custom interval (seconds):"})]}),h.jsxs("div",{className:"mt-1 flex gap-2",children:[h.jsx("input",{type:"number",name:"custom-interval",min:"1",placeholder:"e.g. 45",className:"flex-1 rounded-lg border border-line bg-app px-2 py-1 text-xs text-ink placeholder-ink-faint focus:border-indigo-500 focus:outline-none"}),h.jsx("button",{type:"submit",className:"btn btn-primary rounded-lg px-3 py-1 font-semibold",children:"Set"})]})]}),f&&h.jsx("button",{onClick:x,className:"btn w-full rounded-lg border-line bg-elevated/50 px-3 py-2 text-status-warning-text hover:border-status-warning-border hover:bg-status-warning-bg/40",children:"Stop Auto-Rescan"}),h.jsx("div",{className:"flex justify-end gap-2 border-t border-line pt-3",children:h.jsx("button",{onClick:a,className:"rounded-lg border border-line bg-elevated px-4 py-2 text-xs font-semibold text-ink-secondary hover:bg-elevated/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:"Close"})})]})})}function $k(n,r){const a={};return(n[n.length-1]===""?[...n,""]:n).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const Jk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Wk={};function Xx(n,r){return(Wk.jsx?Pk:Jk).test(n)}const eS=/[ \t\n\f\r]/g;function tS(n){return typeof n=="object"?n.type==="text"?Ix(n.value):!1:Ix(n)}function Ix(n){return n.replace(eS,"")===""}class ou{constructor(r,a,u){this.normal=a,this.property=r,u&&(this.space=u)}}ou.prototype.normal={};ou.prototype.property={};ou.prototype.space=void 0;function ib(n,r){const a={},u={};for(const s of n)Object.assign(a,s.property),Object.assign(u,s.normal);return new ou(a,u,r)}function Nd(n){return n.toLowerCase()}class yn{constructor(r,a){this.attribute=a,this.property=r}}yn.prototype.attribute="";yn.prototype.booleanish=!1;yn.prototype.boolean=!1;yn.prototype.commaOrSpaceSeparated=!1;yn.prototype.commaSeparated=!1;yn.prototype.defined=!1;yn.prototype.mustUseProperty=!1;yn.prototype.number=!1;yn.prototype.overloadedBoolean=!1;yn.prototype.property="";yn.prototype.spaceSeparated=!1;yn.prototype.space=void 0;let nS=0;const De=nr(),Ot=nr(),Ed=nr(),ce=nr(),ht=nr(),Pi=nr(),_n=nr();function nr(){return 2**++nS}const jd=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:Ot,commaOrSpaceSeparated:_n,commaSeparated:Pi,number:ce,overloadedBoolean:Ed,spaceSeparated:ht},Symbol.toStringTag,{value:"Module"})),nd=Object.keys(jd);class Qd extends yn{constructor(r,a,u,s){let d=-1;if(super(r,a),Kx(this,"space",s),typeof u=="number")for(;++d4&&a.slice(0,4)==="data"&&uS.test(r)){if(r.charAt(4)==="-"){const d=r.slice(5).replace(Zx,cS);u="data"+d.charAt(0).toUpperCase()+d.slice(1)}else{const d=r.slice(4);if(!Zx.test(d)){let f=d.replace(aS,sS);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}s=Qd}return new s(u,r)}function sS(n){return"-"+n.toLowerCase()}function cS(n){return n.charAt(1).toUpperCase()}const fS=ib([rb,lS,ob,sb,cb],"html"),Xd=ib([rb,iS,ob,sb,cb],"svg");function dS(n){return n.join(" ").trim()}var $x=/\/\*(?:[^*]|\*(?!\/))*\*\//g,hS=/\n/g,mS=/^\s*/,pS=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,gS=/^:\s*/,xS=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,yS=/^[;\s]*/,bS=` -`,Jx="/",Px="*",Pa="",vS="comment",wS="declaration";function kS(n,r){if(typeof n!="string")throw new TypeError("First argument must be a string");if(!n)return[];r=r||{};var a=1,u=1;function s(S){var T=S.match(hS);T&&(a+=T.length);var L=S.lastIndexOf(bS);u=~L?S.length-L:u+S.length}function d(){var S={line:a,column:u};return function(T){return T.position=new f(S),x(),T}}function f(S){this.start=S,this.end={line:a,column:u},this.source=r.source}f.prototype.content=n;function m(S){var T=new Error(r.source+":"+a+":"+u+": "+S);if(T.reason=S,T.filename=r.source,T.line=a,T.column=u,T.source=n,!r.silent)throw T}function p(S){var T=S.exec(n);if(T){var L=T[0];return s(L),n=n.slice(L.length),T}}function x(){p(mS)}function y(S){for(var T;T=g();)S.push(T);return S}function g(){var S=d();if(!(Jx!=n.charAt(0)||Px!=n.charAt(1))){for(var T=2;Pa!=n.charAt(T)&&(Px!=n.charAt(T)||Jx!=n.charAt(T+1));)++T;if(T+=2,Pa===n.charAt(T-1))return m("End of comment missing");var L=n.slice(2,T-2);return u+=2,s(L),n=n.slice(T),u+=2,S({type:vS,comment:L})}}function w(){var S=d(),T=p(pS);if(T){if(g(),!p(gS))return m("property missing ':'");var L=p(xS),D=S({type:wS,property:T[0].replace($x,Pa).trim(),value:L?L[0].replace($x,Pa).trim():Pa});return p(yS),D}}function v(){var S=[];y(S);for(var T;T=w();)S.push(T),y(S);return S}return x(),v()}function SS(n,r){let a=null;if(!n||typeof n!="string")return a;const u=kS(n),s=typeof r=="function";return u.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:m}=d;s?r(f,m,d):m&&(a=a??{},a[f]=m)}),a}const fb=db("end"),Id=db("start");function db(n){return r;function r(a){const u=a&&a.position&&a.position[n]||{};if(typeof u.line=="number"&&u.line>0&&typeof u.column=="number"&&u.column>0)return{line:u.line,column:u.column,offset:typeof u.offset=="number"&&u.offset>-1?u.offset:void 0}}}function NS(n){const r=Id(n),a=fb(n);if(r&&a)return{start:r,end:a}}function iu(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?Wx(n.position):"start"in n||"end"in n?Wx(n):"line"in n||"column"in n?Cd(n):""}function Cd(n){return ey(n&&n.line)+":"+ey(n&&n.column)}function Wx(n){return Cd(n&&n.start)+"-"+Cd(n&&n.end)}function ey(n){return n&&typeof n=="number"?n:1}class an extends Error{constructor(r,a,u){super(),typeof a=="string"&&(u=a,a=void 0);let s="",d={},f=!1;if(a&&("line"in a&&"column"in a?d={place:a}:"start"in a&&"end"in a?d={place:a}:"type"in a?d={ancestors:[a],place:a.position}:d={...a}),typeof r=="string"?s=r:!d.cause&&r&&(f=!0,s=r.message,d.cause=r),!d.ruleId&&!d.source&&typeof u=="string"){const p=u.indexOf(":");p===-1?d.ruleId=u:(d.source=u.slice(0,p),d.ruleId=u.slice(p+1))}if(!d.place&&d.ancestors&&d.ancestors){const p=d.ancestors[d.ancestors.length-1];p&&(d.place=p.position)}const m=d.place&&"start"in d.place?d.place.start:d.place;this.ancestors=d.ancestors||void 0,this.cause=d.cause||void 0,this.column=m?m.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=m?m.line:void 0,this.name=iu(d.place)||"1:1",this.place=d.place||void 0,this.reason=this.message,this.ruleId=d.ruleId||void 0,this.source=d.source||void 0,this.stack=f&&d.cause&&typeof d.cause.stack=="string"?d.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}an.prototype.file="";an.prototype.name="";an.prototype.reason="";an.prototype.message="";an.prototype.stack="";an.prototype.column=void 0;an.prototype.line=void 0;an.prototype.ancestors=void 0;an.prototype.cause=void 0;an.prototype.fatal=void 0;an.prototype.place=void 0;an.prototype.ruleId=void 0;an.prototype.source=void 0;const Kd={}.hasOwnProperty,ES=new Map,jS=/[A-Z]/g,CS=/-([a-z])/g,TS=new Set(["table","tbody","thead","tfoot","tr"]),_S=new Set(["td","th"]),hb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function AS(n,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=r.filePath||void 0;let u;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");u=BS(a,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");u=US(a,r.jsx,r.jsxs)}const s={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:u,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?Xd:fS,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},d=mb(s,n,void 0);return d&&typeof d!="string"?d:s.create(n,s.Fragment,{children:d||void 0},void 0)}function mb(n,r,a){if(r.type==="element")return zS(n,r,a);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return DS(n,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return OS(n,r,a);if(r.type==="mdxjsEsm")return MS(n,r);if(r.type==="root")return RS(n,r,a);if(r.type==="text")return LS(n,r)}function zS(n,r,a){const u=n.schema;let s=u;r.tagName.toLowerCase()==="svg"&&u.space==="html"&&(s=Xd,n.schema=s),n.ancestors.push(r);const d=gb(n,r.tagName,!1),f=HS(n,r);let m=$d(n,r);return TS.has(r.tagName)&&(m=m.filter(function(p){return typeof p=="string"?!tS(p):!0})),pb(n,f,d,r),Zd(f,m),n.ancestors.pop(),n.schema=u,n.create(r,d,f,a)}function DS(n,r){if(r.data&&r.data.estree&&n.evaluater){const u=r.data.estree.body[0];return u.type,n.evaluater.evaluateExpression(u.expression)}uu(n,r.position)}function MS(n,r){if(r.data&&r.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(r.data.estree);uu(n,r.position)}function OS(n,r,a){const u=n.schema;let s=u;r.name==="svg"&&u.space==="html"&&(s=Xd,n.schema=s),n.ancestors.push(r);const d=r.name===null?n.Fragment:gb(n,r.name,!0),f=qS(n,r),m=$d(n,r);return pb(n,f,d,r),Zd(f,m),n.ancestors.pop(),n.schema=u,n.create(r,d,f,a)}function RS(n,r,a){const u={};return Zd(u,$d(n,r)),n.create(r,n.Fragment,u,a)}function LS(n,r){return r.value}function pb(n,r,a,u){typeof a!="string"&&a!==n.Fragment&&n.passNode&&(r.node=u)}function Zd(n,r){if(r.length>0){const a=r.length>1?r:r[0];a&&(n.children=a)}}function US(n,r,a){return u;function u(s,d,f,m){const x=Array.isArray(f.children)?a:r;return m?x(d,f,m):x(d,f)}}function BS(n,r){return a;function a(u,s,d,f){const m=Array.isArray(d.children),p=Id(u);return r(s,d,f,m,{columnNumber:p?p.column-1:void 0,fileName:n,lineNumber:p?p.line:void 0},void 0)}}function HS(n,r){const a={};let u,s;for(s in r.properties)if(s!=="children"&&Kd.call(r.properties,s)){const d=FS(n,s,r.properties[s]);if(d){const[f,m]=d;n.tableCellAlignToStyle&&f==="align"&&typeof m=="string"&&_S.has(r.tagName)?u=m:a[f]=m}}if(u){const d=a.style||(a.style={});d[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=u}return a}function qS(n,r){const a={};for(const u of r.attributes)if(u.type==="mdxJsxExpressionAttribute")if(u.data&&u.data.estree&&n.evaluater){const d=u.data.estree.body[0];d.type;const f=d.expression;f.type;const m=f.properties[0];m.type,Object.assign(a,n.evaluater.evaluateExpression(m.argument))}else uu(n,r.position);else{const{name:s}=u;let d;if(u.value&&typeof u.value=="object")if(u.value.data&&u.value.data.estree&&n.evaluater){const m=u.value.data.estree.body[0];m.type,d=n.evaluater.evaluateExpression(m.expression)}else uu(n,r.position);else d=u.value===null?!0:u.value;a[s]=d}return a}function $d(n,r){const a=[];let u=-1;const s=n.passKeys?new Map:ES;for(;++us?0:s+r:r=r>s?s:r,a=a>0?a:0,u.length<1e4)f=Array.from(u),f.unshift(r,a),n.splice(...f);else for(a&&n.splice(r,a);d0?(el(n,n.length,0,r),n):r}const ly={}.hasOwnProperty;function yb(n){const r={};let a=-1;for(;++a13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function tl(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Pt=ki(/[A-Za-z]/),Wt=ki(/[\dA-Za-z]/),JS=ki(/[#-'*+\--9=?A-Z^-~]/);function is(n){return n!==null&&(n<32||n===127)}const Td=ki(/\d/),PS=ki(/[\dA-Fa-f]/),vb=ki(/[!-/:-@[-`{-~]/);function Te(n){return n!==null&&n<-2}function mt(n){return n!==null&&(n<0||n===32)}function Ve(n){return n===-2||n===-1||n===32}const fs=ki(new RegExp("\\p{P}|\\p{S}","u")),tr=ki(/\s/);function ki(n){return r;function r(a){return a!==null&&a>-1&&n.test(String.fromCharCode(a))}}function ta(n){const r=[];let a=-1,u=0,s=0;for(;++a55295&&d<57344){const m=n.charCodeAt(a+1);d<56320&&m>56319&&m<57344?(f=String.fromCharCode(d,m),s=1):f="�"}else f=String.fromCharCode(d);f&&(r.push(n.slice(u,a),encodeURIComponent(f)),u=a+s+1,f=""),s&&(a+=s,s=0)}return r.join("")+n.slice(u)}function et(n,r,a,u){const s=u?u-1:1/0;let d=0;return f;function f(p){return Ve(p)?(n.enter(a),m(p)):r(p)}function m(p){return Ve(p)&&d++=s?r(y):a(y)}}const WS={tokenize:eN};function eN(n){const r=n.attempt(this.parser.constructs.contentInitial,u,s);let a;return r;function u(m){if(m===null){n.consume(m);return}return n.enter("lineEnding"),n.consume(m),n.exit("lineEnding"),et(n,r,"linePrefix")}function s(m){return n.enter("paragraph"),d(m)}function d(m){const p=n.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=p),a=p,f(m)}function f(m){if(m===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(m);return}return Te(m)?(n.consume(m),n.exit("chunkText"),d):(n.consume(m),f)}}let rs=class{constructor(){this.index=new Map,this.map=[]}add(r,a,u){iy(this,r,a,u,!1)}addBefore(r,a,u){iy(this,r,a,u,!0)}consume(r){if(this.map.sort(function(d,f){return d[0]-f[0]}),this.map.length===0)return;let a=this.map.length;const u=[];for(;a>0;)a-=1,u.push(r.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),r.length=this.map[a][0];u.push(r.slice()),r.length=0;let s=u.pop();for(;s;){for(const d of s)r.push(d);s=u.pop()}this.map.length=0,this.index.clear()}};function iy(n,r,a,u,s){if(a===0&&u.length===0)return;const d=n.index.get(r);if(d){d[1]+=a,s?(u.push(...d[2]),d[2]=u):d[2].push(...u);return}const f=[r,a,u];n.map.push(f),n.index.set(r,f)}const tN={tokenize:nN},ry={tokenize:lN};function nN(n){const r=this,a=[];let u=0,s,d,f;return m;function m(I){if(uf))return;const R=r.events.length;let Q=R,fe,B;for(;Q--;)if(r.events[Q][0]==="exit"&&r.events[Q][1].type==="chunkFlow"){if(fe){B=r.events[Q][1].end;break}fe=!0}for(D(u),U=R;UI;){const ie=a[J];r.containerState=ie[1],ie[0].exit.call(r,n)}a.length=I}function $(){s.write([null]),d=void 0,s=void 0,r.containerState._closeFlow=void 0}}function lN(n,r,a){return et(n,n.attempt(this.parser.constructs.document,r,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wi(n){if(n===null||mt(n)||tr(n))return 1;if(fs(n))return 2}function ds(n,r,a){const u=[];let s=-1;for(;++s1&&n[a][1].end.offset-n[a][1].start.offset>1?2:1,f={...n[s][1].end},m={...n[a][1].start};ay(f,-d),ay(m,d);const p={type:d>1?"strongSequence":"emphasisSequence",start:f,end:{...n[s][1].end}},x={type:d>1?"strongSequence":"emphasisSequence",start:{...n[a][1].start},end:m},y={type:d>1?"strongText":"emphasisText",start:{...n[s][1].end},end:{...n[a][1].start}},g={type:d>1?"strong":"emphasis",start:{...p.start},end:{...x.end}};n[s][1].end={...p.start},n[a][1].start={...x.end},u=[],n[s][1].end.offset-n[s][1].start.offset&&(u=Yn(u,[["enter",n[s][1],r],["exit",n[s][1],r]])),u=Yn(u,[["enter",g,r],["enter",p,r],["exit",p,r],["enter",y,r]]),u=Yn(u,ds(r.parser.constructs.insideSpan.null,n.slice(s+1,a),r)),u=Yn(u,[["exit",y,r],["enter",x,r],["exit",x,r],["exit",g,r]]);let w=0;n[a][1].end.offset-n[a][1].start.offset&&(w=2,u=Yn(u,[["enter",n[a][1],r],["exit",n[a][1],r]])),el(n,s-1,a-s+3,u),a=s+u.length-w-2;break}}for(a=-1;++a0&&Ve(U)?et(n,$,"linePrefix",d+1)(U):$(U)}function $(U){return U===null||Te(U)?n.check(Ad,T,J)(U):(n.enter("codeFlowValue"),I(U))}function I(U){return U===null||Te(U)?(n.exit("codeFlowValue"),$(U)):(n.consume(U),I)}function J(U){return n.exit("codeFenced"),r(U)}function ie(U,R,Q){let fe=0;return B;function B(ae){return U.enter("lineEnding"),U.consume(ae),U.exit("lineEnding"),ne}function ne(ae){return U.enter("codeFencedFence"),Ve(ae)?et(U,V,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ae):V(ae)}function V(ae){return ae===m?(U.enter("codeFencedFenceSequence"),se(ae)):Q(ae)}function se(ae){return ae===m?(fe++,U.consume(ae),se):fe>=f?(U.exit("codeFencedFenceSequence"),Ve(ae)?et(U,ve,"whitespace")(ae):ve(ae)):Q(ae)}function ve(ae){return ae===null||Te(ae)?(U.exit("codeFencedFence"),R(ae)):Q(ae)}}}const id={name:"codeIndented",tokenize:xN},gN={partial:!0,tokenize:yN};function xN(n,r,a){return u;function u(m){return n.enter("codeIndented"),wb(n,s,a,"linePrefix",4,4)(m)}function s(m){return m===null?f(m):Te(m)?n.attempt(gN,s,f)(m):(n.enter("codeFlowValue"),d(m))}function d(m){return m===null||Te(m)?(n.exit("codeFlowValue"),s(m)):(n.consume(m),d)}function f(m){return n.exit("codeIndented"),r(m)}}function yN(n,r,a){const u=this;return s;function s(f){return u.parser.lazy[u.now().line]?a(f):Te(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),s):wb(n,r,d,"linePrefix",4,4)(f)}function d(f){return Te(f)?s(f):a(f)}}const bN={name:"codeText",previous:wN,resolve:vN,tokenize:kN};function vN(n){let r=n.length-4,a=3,u,s;if((n[a][1].type==="lineEnding"||n[a][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(u=a;++u=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return rthis.left.length?this.right.slice(this.right.length-u+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-u+this.left.length).reverse())}splice(r,a,u){const s=a||0;this.setCursor(Math.trunc(r));const d=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return u&&Wa(this.left,u),d.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),Wa(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Wa(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r=4?r(f):n.interrupt(u.parser.constructs.flow,a,r)(f)}}function jb(n,r,a,u,s,d,f,m,p){const x=p||Number.POSITIVE_INFINITY;let y=0;return g;function g(D){return D===60?(n.enter(u),n.enter(s),n.enter(d),n.consume(D),n.exit(d),w):D===null||D===32||D===41||is(D)?a(D):(n.enter(u),n.enter(f),n.enter(m),n.enter("chunkString",{contentType:"string"}),T(D))}function w(D){return D===62?(n.enter(d),n.consume(D),n.exit(d),n.exit(s),n.exit(u),r):(n.enter(m),n.enter("chunkString",{contentType:"string"}),v(D))}function v(D){return D===62?(n.exit("chunkString"),n.exit(m),w(D)):D===null||D===60||Te(D)?a(D):(n.consume(D),D===92?S:v)}function S(D){return D===60||D===62||D===92?(n.consume(D),v):v(D)}function T(D){return!y&&(D===null||D===41||mt(D))?(n.exit("chunkString"),n.exit(m),n.exit(f),n.exit(u),r(D)):y999||v===null||v===91||v===93&&!p||v===94&&!m&&"_hiddenFootnoteSupport"in f.parser.constructs?a(v):v===93?(n.exit(d),n.enter(s),n.consume(v),n.exit(s),n.exit(u),r):Te(v)?(n.enter("lineEnding"),n.consume(v),n.exit("lineEnding"),y):(n.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||v===91||v===93||Te(v)||m++>999?(n.exit("chunkString"),y(v)):(n.consume(v),p||(p=!Ve(v)),v===92?w:g)}function w(v){return v===91||v===92||v===93?(n.consume(v),m++,g):g(v)}}function Tb(n,r,a,u,s,d){let f;return m;function m(w){return w===34||w===39||w===40?(n.enter(u),n.enter(s),n.consume(w),n.exit(s),f=w===40?41:w,p):a(w)}function p(w){return w===f?(n.enter(s),n.consume(w),n.exit(s),n.exit(u),r):(n.enter(d),x(w))}function x(w){return w===f?(n.exit(d),p(f)):w===null?a(w):Te(w)?(n.enter("lineEnding"),n.consume(w),n.exit("lineEnding"),et(n,x,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),y(w))}function y(w){return w===f||w===null||Te(w)?(n.exit("chunkString"),x(w)):(n.consume(w),w===92?g:y)}function g(w){return w===f||w===92?(n.consume(w),y):y(w)}}function ru(n,r){let a;return u;function u(s){return Te(s)?(n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),a=!0,u):Ve(s)?et(n,u,a?"linePrefix":"lineSuffix")(s):r(s)}}const AN={name:"definition",tokenize:DN},zN={partial:!0,tokenize:MN};function DN(n,r,a){const u=this;let s;return d;function d(v){return n.enter("definition"),f(v)}function f(v){return Cb.call(u,n,m,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function m(v){return s=tl(u.sliceSerialize(u.events[u.events.length-1][1]).slice(1,-1)),v===58?(n.enter("definitionMarker"),n.consume(v),n.exit("definitionMarker"),p):a(v)}function p(v){return mt(v)?ru(n,x)(v):x(v)}function x(v){return jb(n,y,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function y(v){return n.attempt(zN,g,g)(v)}function g(v){return Ve(v)?et(n,w,"whitespace")(v):w(v)}function w(v){return v===null||Te(v)?(n.exit("definition"),u.parser.defined.push(s),r(v)):a(v)}}function MN(n,r,a){return u;function u(m){return mt(m)?ru(n,s)(m):a(m)}function s(m){return Tb(n,d,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(m)}function d(m){return Ve(m)?et(n,f,"whitespace")(m):f(m)}function f(m){return m===null||Te(m)?r(m):a(m)}}const ON={name:"hardBreakEscape",tokenize:RN};function RN(n,r,a){return u;function u(d){return n.enter("hardBreakEscape"),n.consume(d),s}function s(d){return Te(d)?(n.exit("hardBreakEscape"),r(d)):a(d)}}const LN={name:"headingAtx",resolve:UN,tokenize:BN};function UN(n,r){let a=n.length-2,u=3;if(n[u][1].type==="whitespace"&&(u+=2),a-2>u&&n[a][1].type==="whitespace"&&(a-=2),n[a][1].type==="atxHeadingSequence"&&(u===a-1||a-4>u&&n[a-2][1].type==="whitespace")&&(a-=u+1===a?2:4),a>u){const s={type:"atxHeadingText",start:n[u][1].start,end:n[a][1].end},d={type:"chunkText",start:n[u][1].start,end:n[a][1].end,contentType:"text"};el(n,u,a-u+1,[["enter",s,r],["enter",d,r],["exit",d,r],["exit",s,r]])}return n}function BN(n,r,a){let u=0;return s;function s(y){return n.enter("atxHeading"),d(y)}function d(y){return n.enter("atxHeadingSequence"),f(y)}function f(y){return y===35&&u++<6?(n.consume(y),f):y===null||mt(y)?(n.exit("atxHeadingSequence"),m(y)):a(y)}function m(y){return y===35?(n.enter("atxHeadingSequence"),p(y)):y===null||Te(y)?(n.exit("atxHeading"),r(y)):Ve(y)?et(n,m,"whitespace")(y):(n.enter("atxHeadingText"),x(y))}function p(y){return y===35?(n.consume(y),p):(n.exit("atxHeadingSequence"),m(y))}function x(y){return y===null||y===35||mt(y)?(n.exit("atxHeadingText"),m(y)):(n.consume(y),x)}}const _b=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],zd=["pre","script","style","textarea"],HN={concrete:!0,name:"htmlFlow",resolveTo:FN,tokenize:VN},qN={partial:!0,tokenize:YN};function FN(n){let r=n.length;for(;r--&&!(n[r][0]==="enter"&&n[r][1].type==="htmlFlow"););return r>1&&n[r-2][1].type==="linePrefix"&&(n[r][1].start=n[r-2][1].start,n[r+1][1].start=n[r-2][1].start,n.splice(r-2,2)),n}function VN(n,r,a){const u=this;let s,d,f,m,p;return x;function x(M){return y(M)}function y(M){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(M),g}function g(M){return M===33?(n.consume(M),w):M===47?(n.consume(M),d=!0,T):M===63?(n.consume(M),s=3,u.interrupt?r:N):Pt(M)?(n.consume(M),f=String.fromCharCode(M),L):a(M)}function w(M){return M===45?(n.consume(M),s=2,v):M===91?(n.consume(M),s=5,m=0,S):Pt(M)?(n.consume(M),s=4,u.interrupt?r:N):a(M)}function v(M){return M===45?(n.consume(M),u.interrupt?r:N):a(M)}function S(M){const E="CDATA[";return M===E.charCodeAt(m++)?(n.consume(M),m===E.length?u.interrupt?r:V:S):a(M)}function T(M){return Pt(M)?(n.consume(M),f=String.fromCharCode(M),L):a(M)}function L(M){if(M===null||M===47||M===62||mt(M)){const E=M===47,Y=f.toLowerCase();return!E&&!d&&zd.includes(Y)?(s=1,u.interrupt?r(M):V(M)):_b.includes(f.toLowerCase())?(s=6,E?(n.consume(M),D):u.interrupt?r(M):V(M)):(s=7,u.interrupt&&!u.parser.lazy[u.now().line]?a(M):d?$(M):I(M))}return M===45||Wt(M)?(n.consume(M),f+=String.fromCharCode(M),L):a(M)}function D(M){return M===62?(n.consume(M),u.interrupt?r:V):a(M)}function $(M){return Ve(M)?(n.consume(M),$):B(M)}function I(M){return M===47?(n.consume(M),B):M===58||M===95||Pt(M)?(n.consume(M),J):Ve(M)?(n.consume(M),I):B(M)}function J(M){return M===45||M===46||M===58||M===95||Wt(M)?(n.consume(M),J):ie(M)}function ie(M){return M===61?(n.consume(M),U):Ve(M)?(n.consume(M),ie):I(M)}function U(M){return M===null||M===60||M===61||M===62||M===96?a(M):M===34||M===39?(n.consume(M),p=M,R):Ve(M)?(n.consume(M),U):Q(M)}function R(M){return M===p?(n.consume(M),p=null,fe):M===null||Te(M)?a(M):(n.consume(M),R)}function Q(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||mt(M)?ie(M):(n.consume(M),Q)}function fe(M){return M===47||M===62||Ve(M)?I(M):a(M)}function B(M){return M===62?(n.consume(M),ne):a(M)}function ne(M){return M===null||Te(M)?V(M):Ve(M)?(n.consume(M),ne):a(M)}function V(M){return M===45&&s===2?(n.consume(M),A):M===60&&s===1?(n.consume(M),W):M===62&&s===4?(n.consume(M),qe):M===63&&s===3?(n.consume(M),N):M===93&&s===5?(n.consume(M),re):Te(M)&&(s===6||s===7)?(n.exit("htmlFlowData"),n.check(qN,Ge,se)(M)):M===null||Te(M)?(n.exit("htmlFlowData"),se(M)):(n.consume(M),V)}function se(M){return n.check(Ad,ve,Ge)(M)}function ve(M){return n.enter("lineEnding"),n.consume(M),n.exit("lineEnding"),ae}function ae(M){return M===null||Te(M)?se(M):(n.enter("htmlFlowData"),V(M))}function A(M){return M===45?(n.consume(M),N):V(M)}function W(M){return M===47?(n.consume(M),f="",le):V(M)}function le(M){if(M===62){const E=f.toLowerCase();return zd.includes(E)?(n.consume(M),qe):V(M)}return Pt(M)&&f.length<8?(n.consume(M),f+=String.fromCharCode(M),le):V(M)}function re(M){return M===93?(n.consume(M),N):V(M)}function N(M){return M===62?(n.consume(M),qe):M===45&&s===2?(n.consume(M),N):V(M)}function qe(M){return M===null||Te(M)?(n.exit("htmlFlowData"),Ge(M)):(n.consume(M),qe)}function Ge(M){return n.exit("htmlFlow"),r(M)}}function YN(n,r,a){return u;function u(s){return n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),n.attempt(su,r,a)}}const GN={name:"htmlText",tokenize:QN};function QN(n,r,a){const u=this;let s,d,f;return m;function m(N){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(N),p}function p(N){return N===33?(n.consume(N),x):N===47?(n.consume(N),ie):N===63?(n.consume(N),I):Pt(N)?(n.consume(N),Q):a(N)}function x(N){return N===45?(n.consume(N),y):N===91?(n.consume(N),d=0,S):Pt(N)?(n.consume(N),$):a(N)}function y(N){return N===45?(n.consume(N),v):a(N)}function g(N){return N===null?a(N):N===45?(n.consume(N),w):Te(N)?(f=g,W(N)):(n.consume(N),g)}function w(N){return N===45?(n.consume(N),v):g(N)}function v(N){return N===62?A(N):N===45?w(N):g(N)}function S(N){const qe="CDATA[";return N===qe.charCodeAt(d++)?(n.consume(N),d===qe.length?T:S):a(N)}function T(N){return N===null?a(N):N===93?(n.consume(N),L):Te(N)?(f=T,W(N)):(n.consume(N),T)}function L(N){return N===93?(n.consume(N),D):T(N)}function D(N){return N===62?A(N):N===93?(n.consume(N),D):T(N)}function $(N){return N===null||N===62?A(N):Te(N)?(f=$,W(N)):(n.consume(N),$)}function I(N){return N===null?a(N):N===63?(n.consume(N),J):Te(N)?(f=I,W(N)):(n.consume(N),I)}function J(N){return N===62?A(N):I(N)}function ie(N){return Pt(N)?(n.consume(N),U):a(N)}function U(N){return N===45||Wt(N)?(n.consume(N),U):R(N)}function R(N){return Te(N)?(f=R,W(N)):Ve(N)?(n.consume(N),R):A(N)}function Q(N){return N===45||Wt(N)?(n.consume(N),Q):N===47||N===62||mt(N)?fe(N):a(N)}function fe(N){return N===47?(n.consume(N),A):N===58||N===95||Pt(N)?(n.consume(N),B):Te(N)?(f=fe,W(N)):Ve(N)?(n.consume(N),fe):A(N)}function B(N){return N===45||N===46||N===58||N===95||Wt(N)?(n.consume(N),B):ne(N)}function ne(N){return N===61?(n.consume(N),V):Te(N)?(f=ne,W(N)):Ve(N)?(n.consume(N),ne):fe(N)}function V(N){return N===null||N===60||N===61||N===62||N===96?a(N):N===34||N===39?(n.consume(N),s=N,se):Te(N)?(f=V,W(N)):Ve(N)?(n.consume(N),V):(n.consume(N),ve)}function se(N){return N===s?(n.consume(N),s=void 0,ae):N===null?a(N):Te(N)?(f=se,W(N)):(n.consume(N),se)}function ve(N){return N===null||N===34||N===39||N===60||N===61||N===96?a(N):N===47||N===62||mt(N)?fe(N):(n.consume(N),ve)}function ae(N){return N===47||N===62||mt(N)?fe(N):a(N)}function A(N){return N===62?(n.consume(N),n.exit("htmlTextData"),n.exit("htmlText"),r):a(N)}function W(N){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(N),n.exit("lineEnding"),le}function le(N){return Ve(N)?et(n,re,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):re(N)}function re(N){return n.enter("htmlTextData"),f(N)}}const Wd={name:"labelEnd",resolveAll:ZN,resolveTo:$N,tokenize:JN},XN={tokenize:PN},IN={tokenize:WN},KN={tokenize:e3};function ZN(n){let r=-1;const a=[];for(;++r0&&s[s.length-1]._balanced;)s.pop();d=s[s.length-1]}return m;function m(w){return d?d._inactive?g(w):(f=u.parser.defined.includes(tl(u.sliceSerialize({start:d.end,end:u.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(w),n.exit("labelMarker"),n.exit("labelEnd"),p):a(w)}function p(w){return w===40?n.attempt(XN,y,f?y:g)(w):w===91?n.attempt(IN,y,f?x:g)(w):f?y(w):g(w)}function x(w){return n.attempt(KN,y,g)(w)}function y(w){return s.pop(),r(w)}function g(w){return d._balanced=!0,a(w)}}function PN(n,r,a){return u;function u(g){return n.enter("resource"),n.enter("resourceMarker"),n.consume(g),n.exit("resourceMarker"),s}function s(g){return mt(g)?ru(n,d)(g):d(g)}function d(g){return g===41?y(g):jb(n,f,m,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function f(g){return mt(g)?ru(n,p)(g):y(g)}function m(g){return a(g)}function p(g){return g===34||g===39||g===40?Tb(n,x,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function x(g){return mt(g)?ru(n,y)(g):y(g)}function y(g){return g===41?(n.enter("resourceMarker"),n.consume(g),n.exit("resourceMarker"),n.exit("resource"),r):a(g)}}function WN(n,r,a){const u=this;return s;function s(m){return Cb.call(u,n,d,f,"reference","referenceMarker","referenceString")(m)}function d(m){return u.parser.defined.includes(tl(u.sliceSerialize(u.events[u.events.length-1][1]).slice(1,-1)))?r(m):a(m)}function f(m){return a(m)}}function e3(n,r,a){return u;function u(d){return n.enter("reference"),n.enter("referenceMarker"),n.consume(d),n.exit("referenceMarker"),s}function s(d){return d===93?(n.enter("referenceMarker"),n.consume(d),n.exit("referenceMarker"),n.exit("reference"),r):a(d)}}const t3={name:"labelStartImage",resolveAll:Wd.resolveAll,tokenize:n3};function n3(n,r,a){const u=this;let s;return d;function d(p){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(p),n.exit("labelImageMarker"),f}function f(p){return p===91?(n.enter("labelMarker"),n.consume(p),n.exit("labelMarker"),s=n.exit("labelImage"),m):a(p)}function m(p){return p===94&&"_hiddenFootnoteSupport"in u.parser.constructs?a(p):(u._labelStarts=u._labelStarts||[],u._labelStarts.push(s),r(p))}}const l3={name:"labelStartLink",resolveAll:Wd.resolveAll,tokenize:i3};function i3(n,r,a){const u=this;let s;return d;function d(m){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(m),n.exit("labelMarker"),s=n.exit("labelLink"),f}function f(m){return m===94&&"_hiddenFootnoteSupport"in u.parser.constructs?a(m):(u._labelStarts=u._labelStarts||[],u._labelStarts.push(s),r(m))}}const rd={name:"lineEnding",tokenize:r3};function r3(n,r){return a;function a(u){return n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),et(n,r,"linePrefix")}}const ts={name:"thematicBreak",tokenize:a3};function a3(n,r,a){let u=0,s;return d;function d(x){return n.enter("thematicBreak"),f(x)}function f(x){return s=x,m(x)}function m(x){return x===s?(n.enter("thematicBreakSequence"),p(x)):u>=3&&(x===null||Te(x))?(n.exit("thematicBreak"),r(x)):a(x)}function p(x){return x===s?(n.consume(x),u++,p):(n.exit("thematicBreakSequence"),Ve(x)?et(n,m,"whitespace")(x):m(x))}}const xn={continuation:{tokenize:c3},exit:d3,name:"list",tokenize:s3},u3={partial:!0,tokenize:h3},o3={partial:!0,tokenize:f3};function s3(n,r,a){const u=this,s=u.events[u.events.length-1];let d=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,f=0;return m;function m(v){const S=u.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!u.containerState.marker||v===u.containerState.marker:Td(v)){if(u.containerState.type||(u.containerState.type=S,n.enter(S,{_container:!0})),S==="listUnordered")return n.enter("listItemPrefix"),v===42||v===45?n.check(ts,a,x)(v):x(v);if(!u.interrupt||v===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),p(v)}return a(v)}function p(v){return Td(v)&&++f<10?(n.consume(v),p):(!u.interrupt||f<2)&&(u.containerState.marker?v===u.containerState.marker:v===41||v===46)?(n.exit("listItemValue"),x(v)):a(v)}function x(v){return n.enter("listItemMarker"),n.consume(v),n.exit("listItemMarker"),u.containerState.marker=u.containerState.marker||v,n.check(su,u.interrupt?a:y,n.attempt(u3,w,g))}function y(v){return u.containerState.initialBlankLine=!0,d++,w(v)}function g(v){return Ve(v)?(n.enter("listItemPrefixWhitespace"),n.consume(v),n.exit("listItemPrefixWhitespace"),w):a(v)}function w(v){return u.containerState.size=d+u.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(v)}}function c3(n,r,a){const u=this;return u.containerState._closeFlow=void 0,n.check(su,s,d);function s(m){return u.containerState.furtherBlankLines=u.containerState.furtherBlankLines||u.containerState.initialBlankLine,et(n,r,"listItemIndent",u.containerState.size+1)(m)}function d(m){return u.containerState.furtherBlankLines||!Ve(m)?(u.containerState.furtherBlankLines=void 0,u.containerState.initialBlankLine=void 0,f(m)):(u.containerState.furtherBlankLines=void 0,u.containerState.initialBlankLine=void 0,n.attempt(o3,r,f)(m))}function f(m){return u.containerState._closeFlow=!0,u.interrupt=void 0,et(n,n.attempt(xn,r,a),"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m)}}function f3(n,r,a){const u=this;return et(n,s,"listItemIndent",u.containerState.size+1);function s(d){const f=u.events[u.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===u.containerState.size?r(d):a(d)}}function d3(n){n.exit(this.containerState.type)}function h3(n,r,a){const u=this;return et(n,s,"listItemPrefixWhitespace",u.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(d){const f=u.events[u.events.length-1];return!Ve(d)&&f&&f[1].type==="listItemPrefixWhitespace"?r(d):a(d)}}const oy={name:"setextUnderline",resolveTo:m3,tokenize:p3};function m3(n,r){const a=new rs;let u=n.length,s,d,f;for(;u--;)if(n[u][0]==="enter"){if(n[u][1].type==="content"){s=u;break}n[u][1].type==="paragraph"&&(d=u)}else n[u][1].type==="content"&&a.add(u,1,[]),!f&&n[u][1].type==="definition"&&(f=u);const m={type:"setextHeading",start:{...n[s][1].start},end:{...n[n.length-1][1].end}};return n[d][1].type="setextHeadingText",f?(a.add(d,0,[["enter",m,r]]),a.add(f+1,0,[["exit",n[s][1],r]]),n[s][1].end={...n[f][1].end}):n[s][1]=m,a.add(n.length,0,[["exit",m,r]]),a.consume(n),n}function p3(n,r,a){const u=this;let s;return d;function d(x){let y=u.events.length,g;for(;y--;)if(u.events[y][1].type!=="lineEnding"&&u.events[y][1].type!=="linePrefix"&&u.events[y][1].type!=="content"){g=u.events[y][1].type==="paragraph";break}return!u.parser.lazy[u.now().line]&&(u.interrupt||g)?(n.enter("setextHeadingLine"),s=x,f(x)):a(x)}function f(x){return n.enter("setextHeadingLineSequence"),m(x)}function m(x){return x===s?(n.consume(x),m):(n.exit("setextHeadingLineSequence"),Ve(x)?et(n,p,"lineSuffix")(x):p(x))}function p(x){return x===null||Te(x)?(n.exit("setextHeadingLine"),r(x)):a(x)}}const g3={tokenize:x3};function x3(n){const r=this,a=n.attempt(su,u,n.attempt(this.parser.constructs.flowInitial,s,et(n,n.attempt(this.parser.constructs.flow,s,n.attempt(EN,s)),"linePrefix")));return a;function u(d){if(d===null){n.consume(d);return}return n.enter("lineEndingBlank"),n.consume(d),n.exit("lineEndingBlank"),r.currentConstruct=void 0,a}function s(d){if(d===null){n.consume(d);return}return n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),r.currentConstruct=void 0,a}}const y3={resolveAll:zb()},b3=Ab("string"),v3=Ab("text");function Ab(n){return{resolveAll:zb(n==="text"?w3:void 0),tokenize:r};function r(a){const u=this,s=this.parser.constructs[n],d=a.attempt(s,f,m);return f;function f(y){return x(y)?d(y):m(y)}function m(y){if(y===null){a.consume(y);return}return a.enter("data"),a.consume(y),p}function p(y){return x(y)?(a.exit("data"),d(y)):(a.consume(y),p)}function x(y){if(y===null)return!0;const g=s[y];let w=-1;if(g)for(;++w-1){const m=f[0];typeof m=="string"?f[0]=m.slice(u):f.shift()}d>0&&f.push(n[s].slice(0,d))}return f}function O3(n,r){let a=-1;const u=[];let s;for(;++a1}}function ak({directory:n}){const[r,a]=_.useState(0);_.useEffect(()=>{a(0);const d=window.setInterval(()=>{a(f=>f+1)},1e3);return()=>window.clearInterval(d)},[]);const{label:u,cut:s}=rk(n);return h.jsxs("div",{"data-testid":"scan-status-strip",className:"flex min-w-0 items-center gap-1.5 text-[11px] text-ink-muted",children:[h.jsx(Wi,{className:"h-3 w-3 shrink-0 animate-spin text-chip-indigo-text motion-reduce:animate-none","aria-hidden":"true"}),h.jsxs("span",{className:"min-w-0 truncate",children:["Scanning",n&&h.jsxs(h.Fragment,{children:[" ",h.jsxs("span",{className:"font-mono text-ink-secondary",title:n,children:[s?"…/":"",u]})]})," — ",h.jsx("span",{className:"font-mono tabular-nums text-ink-secondary",children:ik(r)})]})]})}function uk({onExecute:n,scanning:r,hasSelection:a,fileCount:u,totalCount:s,scanningDirectory:d="",toastMessage:f,onToastDismiss:m}){const p=(f==null?void 0:f.kind)==="error";return h.jsxs("div",{className:"relative flex items-center justify-between border-t border-line bg-surface-glass px-4 py-2.5 text-xs transition-colors duration-200",children:[f&&h.jsx("div",{role:"status","aria-live":p?"assertive":"polite","aria-atomic":"true",className:`animate-toast-in absolute left-1/2 top-1/2 z-[var(--z-toast)] max-w-[min(80vw,640px)] -translate-x-1/2 -translate-y-1/2 rounded-xl border px-4 py-2 text-xs font-medium glass-panel-strong ${p?"pointer-events-auto flex max-w-[min(70vw,560px)] items-center gap-2.5 border-status-danger-border text-left text-ink":"pointer-events-none max-w-[min(70vw,560px)] text-center text-ink"}`,children:p?h.jsxs(h.Fragment,{children:[h.jsx(bd,{className:"h-3.5 w-3.5 shrink-0 text-status-danger-text/80","aria-hidden":"true"}),h.jsx("span",{className:"min-w-0 flex-1",children:f.message}),m&&h.jsx("button",{type:"button",onClick:m,"aria-label":"Dismiss error",className:"shrink-0 rounded-md p-0.5 text-status-danger-text/60 hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-status-danger-border transition-colors",children:h.jsx(nl,{className:"h-3.5 w-3.5"})})]}):f.message}),h.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[r&&h.jsx(ak,{directory:d}),s!==void 0&&s!==u&&h.jsxs("span",{"data-testid":"action-bar-count",className:"text-ink-muted",children:["Showing ",u," of ",s]})]}),h.jsxs("button",{onClick:n,disabled:!a||r,className:"flex shrink-0 items-center gap-2 rounded-xl border border-emerald-300/50 bg-gradient-to-b from-emerald-400/90 to-emerald-600/90 px-5 py-2 font-semibold text-white shadow-[inset_0_1px_0_rgb(255_255_255/0.35),0_8px_24px_-6px_rgb(16_185_129/0.55)] transition-[filter,box-shadow,transform] hover:-translate-y-px hover:brightness-110 hover:shadow-[inset_0_1px_0_rgb(255_255_255/0.35),0_12px_30px_-6px_rgb(16_185_129/0.7)] disabled:opacity-40 disabled:hover:translate-y-0 disabled:hover:brightness-100 disabled:hover:shadow-[inset_0_1px_0_rgb(255_255_255/0.35),0_8px_24px_-6px_rgb(16_185_129/0.55)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400",children:[h.jsx(er,{className:"h-3.5 w-3.5 fill-current"}),h.jsx("span",{children:"Execute"}),h.jsx("kbd",{className:"rounded bg-emerald-800/60 px-1.5 py-0.5 text-[10px] text-emerald-200 shadow-[inset_0_1px_0_rgb(255_255_255/0.12)]",children:"↵"})]})]})}function ok({position:n,onClose:r,onLaunch:a,onLaunchWithArgs:u,onReveal:s,onOpenFolder:d,onOpenTerminal:f,onScanDirectory:m,onFilterFolder:p,onFilterExtension:x,onCopyPath:y,onCopyFilename:g,onCopyUri:w,onComputeHash:v,onVerifyHash:S,onProperties:T,onClearFile:L,onGenerateBarcode:D,showToast:$}){const[I,J]=_.useState(!1),[ie,U]=_.useState(""),R=_.useRef(null),Q=_.useRef(null),fe=_.useRef(null),[B,ne]=_.useState(null);if(_.useEffect(()=>{var re;I&&((re=Q.current)==null||re.showModal())},[I]),_.useLayoutEffect(()=>{if(!n){ne(null);return}const re=()=>{const N=R.current;if(!N)return;const qe=N.getBoundingClientRect(),Ge=8;ne({left:Math.max(Ge,Math.min(n.x,window.innerWidth-qe.width-Ge)),top:Math.max(Ge,Math.min(n.y,window.innerHeight-qe.height-Ge))})};return re(),window.addEventListener("resize",re),()=>window.removeEventListener("resize",re)},[n]),_.useEffect(()=>{if(!n)return;fe.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const re=window.requestAnimationFrame(()=>{var N,qe;(qe=(N=R.current)==null?void 0:N.querySelector("[role='menuitem']"))==null||qe.focus()});return()=>{var N;window.cancelAnimationFrame(re),(N=fe.current)==null||N.focus()}},[n]),!n)return null;const{file:V,x:se,y:ve}=n,ae=()=>{u(V,ie),J(!1),r()},A=re=>{const N=re.lastIndexOf(".");return N!==-1?re.slice(N):""},W=re=>{const N=Math.max(re.lastIndexOf("/"),re.lastIndexOf("\\"));return N!==-1?re.slice(0,N):re},le=re=>{const N=Math.max(re.lastIndexOf("/"),re.lastIndexOf("\\"));return N!==-1?re.slice(0,N):""};return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 z-[calc(var(--z-context-menu)-1)]",onClick:r,onContextMenu:re=>{re.preventDefault(),r()},"aria-hidden":"true"}),h.jsxs("div",{ref:R,role:"menu","aria-label":`Actions for ${V.filename}`,tabIndex:0,onKeyDown:re=>{var Ge,M,E,Y;["Escape","ArrowDown","ArrowUp","Home","End"].includes(re.key)&&re.stopPropagation();const N=Array.from(((Ge=R.current)==null?void 0:Ge.querySelectorAll("[role='menuitem']"))??[]),qe=N.indexOf(document.activeElement);if(re.key==="Escape")re.preventDefault(),r();else if(re.key==="ArrowDown"||re.key==="ArrowUp"){re.preventDefault();const oe=re.key==="ArrowDown"?1:-1;(M=N[(qe+oe+N.length)%N.length])==null||M.focus()}else re.key==="Home"?(re.preventDefault(),(E=N[0])==null||E.focus()):re.key==="End"&&(re.preventDefault(),(Y=N.at(-1))==null||Y.focus())},className:"animate-modal-in fixed z-[var(--z-context-menu)] max-h-[calc(100dvh-16px)] w-56 max-w-[calc(100vw-16px)] overflow-y-auto rounded-lg border border-line bg-surface-glass py-1 text-xs text-ink shadow-2xl backdrop-blur-md",style:B??{left:se,top:ve,visibility:"hidden"},children:[h.jsx("div",{className:"border-b border-line px-3 py-2 font-medium text-ink-muted truncate",children:V.filename}),h.jsxs("button",{role:"menuitem",onClick:()=>{a(V),r()},className:"flex w-full items-center gap-2 px-3 py-3 min-h-[44px] hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Launch ${V.filename}`,children:[h.jsx(er,{className:"h-3.5 w-3.5 fill-current text-status-success-text group-hover:text-white"}),h.jsx("span",{children:"Launch"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{J(!0)},className:"flex w-full items-center gap-2 px-3 py-3 min-h-[44px] hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Launch ${V.filename} with arguments`,children:[h.jsx(er,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Launch with arguments..."})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{s(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Reveal ${V.filename} in file manager`,children:[h.jsx(vd,{className:"h-3.5 w-3.5 text-chip-sky-text group-hover:text-white"}),h.jsx("span",{children:"Reveal in File Manager"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{d(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Open folder containing ${V.filename}`,children:[h.jsx(Ji,{className:"h-3.5 w-3.5 text-chip-amber-text group-hover:text-white"}),h.jsx("span",{children:"Open Folder"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{f(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Open terminal in directory containing ${V.filename}`,children:[h.jsx(kd,{className:"h-3.5 w-3.5 text-status-success-text group-hover:text-white"}),h.jsx("span",{children:"Open Terminal in Directory"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{D(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":"Generate QR Code",children:[h.jsx(Gd,{className:"h-3.5 w-3.5 text-chip-fuchsia-text group-hover:text-white"}),h.jsx("span",{children:"Generate QR Code"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{const re=W(V.path);m(re),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":"Scan to Directory",children:[h.jsx(Ji,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Scan to Directory"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{const re=le(V.rel_path);re&&p(re),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Filter view to folder ${V.filename} is in`,children:[h.jsx(wd,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Filter to Folder"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{const re=A(V.filename);re&&x(re),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Filter view by extension ${A(V.filename)}`,children:[h.jsx(wd,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Filter by Extension"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{y(V,!1),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy full path of ${V.filename}`,children:[h.jsx(yn,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Full Path"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{y(V,!0),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy path of ${V.filename} with forward slashes`,children:[h.jsx(yn,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Path (Forward Slashes)"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{g(V,!1),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy filename of ${V.filename}`,children:[h.jsx(yn,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Filename"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{g(V,!0),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy filename of ${V.filename} without extension`,children:[h.jsx(yn,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Filename (no ext)"})]}),h.jsxs("button",{role:"menuitem",onClick:async()=>{const re=W(V.path);r();try{await navigator.clipboard.writeText(re),$==null||$(`Copied: ${re}`)}catch(N){$==null||$(`Copy failed: ${(N==null?void 0:N.message)??N}`,"error")}},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":"Copy Directory",children:[h.jsx(yn,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Directory"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{w(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy URI of ${V.filename}`,children:[h.jsx(yn,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy URI"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{v(V,"md5"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Compute MD5 hash of ${V.filename}`,children:[h.jsx(Zr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Compute MD5 Hash"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{v(V,"sha256"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Compute SHA256 hash of ${V.filename}`,children:[h.jsx(Zr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Compute SHA256 Hash"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{S(V,"md5"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Verify MD5 hash of ${V.filename}`,children:[h.jsx(Zr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Verify MD5 Hash"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{S(V,"sha256"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Verify SHA256 hash of ${V.filename}`,children:[h.jsx(Zr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Verify SHA256 Hash"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{T(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`View properties of ${V.filename}`,children:[h.jsx(vd,{className:"h-3.5 w-3.5 text-chip-sky-text group-hover:text-white"}),h.jsx("span",{children:"Properties"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{L(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Remove ${V.filename} from list`,children:[h.jsx(Wy,{className:"h-3.5 w-3.5 text-status-danger-text group-hover:text-white"}),h.jsx("span",{children:"Delete"})]})]}),I&&h.jsx("dialog",{ref:Q,className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 rounded-xl","aria-labelledby":"args-modal-title",onClick:re=>{re.target===Q.current&&J(!1)},onCancel:re=>{re.preventDefault(),J(!1)},children:h.jsxs("div",{className:"animate-modal-in w-96 rounded-xl border border-frame-line glass-panel p-4",children:[h.jsx("h3",{id:"args-modal-title",className:"mb-2 text-sm font-semibold text-ink",children:"Launch with Arguments"}),h.jsx("p",{className:"mb-3 text-xs text-ink-muted truncate",children:V.filename}),h.jsx("input",{type:"text",autoFocus:!0,placeholder:"Arguments (e.g. --verbose --port 80)",value:ie,onChange:re=>U(re.target.value),onKeyDown:re=>{re.key==="Enter"&&ae(),re.key==="Escape"&&J(!1)},className:"mb-4 w-full rounded-md border border-line bg-elevated px-3 py-2 text-xs text-ink outline-none focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500","aria-label":"Command line arguments"}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx("button",{onClick:()=>J(!1),className:"rounded-md px-3 py-1.5 text-xs text-ink-muted hover:bg-elevated hover:text-ink focus:outline-none focus:ring-2 focus:ring-indigo-500","aria-label":"Cancel launch",children:"Cancel"}),h.jsx("button",{onClick:ae,className:"btn btn-primary px-3 py-1.5","aria-label":`Launch ${V.filename} with arguments`,children:"Launch"})]})]})})]})}var sk=Yy();const bl=8,bi=8,ck=400,Ox={top:"bottom",bottom:"top",left:"right",right:"left"},fk={top:"-bottom-1 left-1/2 -translate-x-1/2",bottom:"-top-1 left-1/2 -translate-x-1/2",left:"-right-1 top-1/2 -translate-y-1/2",right:"-left-1 top-1/2 -translate-y-1/2"},dk={top:"border-b border-r",bottom:"border-t border-l",left:"border-t border-r",right:"border-b border-l"},Rx=(n,r,a)=>{switch(n){case"top":return r.top-bi-a.h>=bl;case"bottom":return r.bottom+bi+a.h<=window.innerHeight-bl;case"left":return r.left-bi-a.w>=bl;default:return r.right+bi+a.w<=window.innerWidth-bl}},hk=(n,r,a)=>{if(n==="top"||n==="bottom"){const f=r.left+r.width/2-a.w/2,m=window.innerWidth-a.w-bl;return{x:Math.min(Math.max(f,bl),Math.max(bl,m))-f,y:0}}const u=r.top+r.height/2-a.h/2,s=window.innerHeight-a.h-bl;return{x:0,y:Math.min(Math.max(u,bl),Math.max(bl,s))-u}},He=({text:n,children:r,block:a=!0,placement:u="top",suppress:s=!1})=>{const d=_.useRef(null),f=_.useRef(null),m=_.useId(),p=_.useRef(null),[x,y]=_.useState(!1),[g,w]=_.useState(u),[v,S]=_.useState({x:0,y:0}),[T,L]=_.useState({left:-9999,top:-9999}),D=()=>{p.current!==null&&(window.clearTimeout(p.current),p.current=null)};_.useEffect(()=>{s&&(D(),y(!1))},[s]),_.useEffect(()=>()=>D(),[]);const $=_.useCallback(()=>{const U=d.current,R=f.current;if(!U||!R)return;const Q=U.getBoundingClientRect(),fe={w:R.offsetWidth,h:R.offsetHeight},B=Rx(u,Q,fe)?u:Rx(Ox[u],Q,fe)?Ox[u]:u,ne=hk(B,Q,fe);w(B),S(ne);const V=Q.left+Q.width/2,se=Q.top+Q.height/2;L(B==="top"?{left:V,top:Q.top-bi-fe.h}:B==="bottom"?{left:V,top:Q.bottom+bi}:B==="left"?{left:Q.left-bi-fe.w,top:se}:{left:Q.right+bi,top:se})},[u]);_.useEffect(()=>{if(!x)return;const U=()=>y(!1);return window.addEventListener("resize",U),window.addEventListener("scroll",U,!0),()=>{window.removeEventListener("resize",U),window.removeEventListener("scroll",U,!0)}},[x]);const I=U=>{if(s)return;D();const R=()=>{$(),y(!0)};U?R():p.current=window.setTimeout(R,ck)},J=()=>{D(),y(!1)};_.useEffect(()=>{if(!x)return;const U=R=>{R.key==="Escape"&&y(!1)};return document.addEventListener("keydown",U,!0),()=>document.removeEventListener("keydown",U,!0)},[x]),_.useEffect(()=>{if(!x)return;const U=()=>!!document.querySelector('[role="dialog"][aria-modal="true"], dialog[open]');if(U()){y(!1);return}const R=new MutationObserver(()=>{U()&&y(!1)});return R.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["role","aria-modal","open","class"]}),()=>R.disconnect()},[x]);const ie={onMouseEnter:()=>I(!1),onMouseLeave:J,onFocus:()=>I(!0),onBlur:J,"aria-describedby":m};return h.jsxs("div",{ref:d,className:`group relative ${a?"flex min-w-0 flex-1 items-center":"inline-flex shrink-0 items-center"}`,onMouseEnter:()=>I(!1),onMouseLeave:J,onFocus:()=>I(!0),onBlur:J,children:[_.cloneElement(r,ie),sk.createPortal(h.jsxs("span",{ref:f,id:m,role:"tooltip",className:`pointer-events-none invisible fixed z-[var(--z-tooltip)] w-max max-w-[calc(100vw-16px)] rounded-md border border-line bg-elevated px-2 py-1 text-left text-[11px] leading-relaxed text-ink shadow-lg ${x?"visible opacity-100":"opacity-0"}`,style:{left:T.left,top:T.top,transform:g==="top"||g==="bottom"?`translateX(calc(-50% + ${v.x}px))`:`translateY(calc(-50% + ${v.y}px))`},children:[n,h.jsx("span",{className:`absolute h-2 w-2 rotate-45 border-line bg-elevated ${fk[g]} ${dk[g]}`,style:g==="top"||g==="bottom"?{left:`calc(50% - ${v.x}px)`}:void 0})]}),document.body)]})};function mk({isOpen:n,initialPath:r,onClose:a,onSelect:u}){const[s,d]=_.useState(null),[f,m]=_.useState(null),[p,x]=_.useState(""),[y,g]=_.useState(!1),[w,v]=_.useState(null),S=_.useRef(null),T=_.useRef(null),L=_.useRef(null);_.useEffect(()=>{var ie;if(!n){(ie=L.current)==null||ie.focus();return}L.current=document.activeElement instanceof HTMLElement?document.activeElement:null,v(null),D(r||"");const J=requestAnimationFrame(()=>{var U;return(U=T.current)==null?void 0:U.focus()});return()=>{var U;cancelAnimationFrame(J),(U=L.current)==null||U.focus()}},[n]);const D=async J=>{g(!0),v(null);try{const ie=await fetch(`/api/fs/browse?path=${encodeURIComponent(J)}`);if(!ie.ok)throw new Error("Failed to browse directory");const U=await ie.json();d(U),m(U.current_path),x(U.current_path)}catch(ie){v(ie.message||"Navigation failed")}finally{g(!1)}},$=()=>{const J=p.trim()||f;J&&(u(J),a())},I=J=>{var Q;if(J.key==="Escape"){J.preventDefault(),a();return}if(J.key!=="Tab")return;const ie=(Q=S.current)==null?void 0:Q.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(!(ie!=null&&ie.length))return;const U=ie[0],R=ie[ie.length-1];J.shiftKey&&document.activeElement===U?(J.preventDefault(),R.focus()):!J.shiftKey&&document.activeElement===R&&(J.preventDefault(),U.focus())};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/65 p-3 backdrop-blur-sm sm:p-6",onClick:a,children:h.jsxs("div",{ref:S,role:"dialog","aria-modal":"true","aria-labelledby":"directory-picker-title",onKeyDown:I,className:"animate-modal-in flex h-[min(84dvh,760px)] max-h-[calc(100dvh-1.5rem)] w-[min(94vw,960px)] min-h-0 flex-col overflow-hidden rounded-xl border border-frame-line glass-panel sm:rounded-2xl",onClick:J=>J.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-line px-4 py-3 sm:px-5",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Ji,{className:"h-5 w-5 text-chip-indigo-text"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{id:"directory-picker-title",className:"text-sm font-semibold text-ink",children:"Select a directory"}),h.jsx("p",{className:"truncate font-mono text-xs text-ink-muted",children:(s==null?void 0:s.current_path)||""})]})]}),h.jsx(He,{text:"Close",block:!1,children:h.jsx("button",{type:"button",onClick:a,"aria-label":"Close directory picker",className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg text-ink-muted transition-colors hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(nl,{className:"h-4 w-4"})})})]}),h.jsxs("div",{className:"border-b border-line px-4 py-3 sm:px-5",children:[h.jsx("label",{htmlFor:"directory-picker-path",className:"mb-1.5 block text-xs font-medium text-ink-secondary",children:"Location"}),h.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[h.jsx("input",{ref:T,id:"directory-picker-path",type:"text",value:p,onChange:J=>x(J.target.value),onKeyDown:J=>{J.key==="Enter"&&D(p.trim())},placeholder:"/path/to/directory",className:"h-10 min-w-0 flex-1 rounded-lg border border-line bg-elevated px-2.5 font-mono text-sm text-ink outline-none placeholder:text-ink-faint transition-colors hover:bg-surface-strong focus-visible:border-indigo-500 focus-visible:ring-2 focus-visible:ring-indigo-500/30"}),h.jsx("button",{type:"button",onClick:()=>D(p.trim()),className:"inline-flex h-10 shrink-0 items-center gap-1.5 rounded-lg border border-line bg-elevated px-3.5 text-sm font-medium text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Go"}),h.jsx(He,{text:"Home directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>D(""),"aria-label":"Home directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Yd,{className:"h-4 w-4"})})}),(s==null?void 0:s.parent_path)&&h.jsx(He,{text:"Parent directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>D(s.parent_path),"aria-label":"Parent directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Vd,{className:"h-4 w-4 rotate-180"})})})]})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 py-2 sm:px-3 sm:py-3","aria-busy":y,children:y?h.jsxs("div",{className:"flex h-full items-center justify-center gap-2.5 text-sm text-ink-muted",children:[h.jsx(Wi,{className:"h-5 w-5 animate-spin text-chip-indigo-text"}),h.jsx("span",{role:"status",children:"Loading directories…"})]}):w?h.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-2.5 text-center",children:[h.jsx("p",{className:"text-sm text-status-danger-text",children:w}),h.jsx("button",{type:"button",onClick:()=>D(p||(s==null?void 0:s.current_path)||""),className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Retry"})]}):h.jsxs("ul",{className:"space-y-0.5",children:[s==null?void 0:s.items.filter(J=>J.is_dir).map(J=>h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>D(J.path),onDoubleClick:()=>{x(J.path),u(J.path),a()},className:`flex min-h-10 w-full items-center justify-between rounded-lg px-3 py-1.5 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-400 ${f===J.path?"bg-chip-indigo-bg text-chip-indigo-text":"text-ink-secondary hover:bg-elevated hover:text-ink"}`,children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx(ss,{className:"h-5 w-5 shrink-0 text-chip-indigo-text"}),h.jsx("span",{className:"truncate",children:J.name})]}),f===J.path&&h.jsx(vi,{className:"h-4 w-4 shrink-0 text-chip-indigo-text"})]})},J.path)),(s==null?void 0:s.items.filter(J=>J.is_dir).length)===0&&h.jsxs("li",{className:"flex h-full min-h-36 flex-col items-center justify-center gap-2.5 text-center text-sm text-ink-muted",children:[h.jsx(Ji,{className:"h-7 w-7 text-ink-faint"}),"No subdirectories found"]})]})}),h.jsxs("div",{className:"flex flex-col gap-2 border-t border-line px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"mb-0.5 text-xs font-medium text-ink-muted",children:"Selected folder"}),h.jsx("p",{className:"truncate font-mono text-sm text-ink",title:f||p,children:f||p||"—"})]}),h.jsxs("div",{className:"flex shrink-0 justify-end gap-1.5",children:[h.jsx("button",{type:"button",onClick:a,className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Cancel"}),h.jsxs("button",{type:"button",onClick:$,disabled:!p.trim(),className:"btn btn-primary min-h-10 rounded-lg px-4 text-sm font-semibold",children:[h.jsx(Ji,{className:"h-4 w-4"}),"Select folder"]})]})]})]})}):null}function pk({visible:n,onFileSelected:r}){const a=_.useRef(null);return n?h.jsxs("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-drop-overlay)] flex items-center justify-center bg-black/65 backdrop-blur-sm",onClick:()=>{var u;return(u=a.current)==null?void 0:u.click()},"data-testid":"drop-config-overlay",children:[h.jsx("input",{ref:a,type:"file",accept:".profiles,.profiles.yaml,.profiles.yml,.yaml,.yml",className:"hidden",onChange:u=>{var d;const s=(d=u.target.files)==null?void 0:d[0];s&&r(s),u.target.value=""}}),h.jsxs("div",{className:"rounded-xl border-2 border-dashed border-chip-indigo-border bg-surface px-8 py-6 text-center shadow-2xl",children:[h.jsx("span",{className:"mx-auto mb-3 grid h-9 w-9 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Kr,{className:"h-5 w-5 text-chip-indigo-text"})}),h.jsx("p",{className:"text-sm font-semibold text-ink",children:"Drop configuration file"}),h.jsx("p",{className:"mt-1 text-xs text-ink-muted",children:".profiles, .profiles.yaml, .yml, .yaml — session-only preview"})]})]}):null}function gk({items:n,columnTemplate:r,resizePointerRef:a,resizeMovedRef:u}){return h.jsx("div",{className:"grid select-none items-center border-b border-l-2 border-l-transparent border-line/40 bg-surface/60 font-medium text-ink-muted shadow-sm backdrop-blur-md",role:"row","aria-rowindex":1,"data-file-list-header":!0,style:{gridTemplateColumns:r},children:n.map((s,d)=>{const f=!!(s.onSort&&s.sortKey),m=s.active?s.direction==="asc"?"ascending":"descending":"none";return h.jsxs("div",{role:"columnheader","data-column-key":s.sortKey,className:`group relative flex items-center gap-1.5 truncate px-3 py-2 ${f?"cursor-pointer hover:text-ink transition-colors":""} ${s.active?"text-ink":""}`,...f?{"aria-sort":m,tabIndex:0,onClick:s.onSort,onKeyDown:p=>{var x;(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),(x=s.onSort)==null||x.call(s))}}:{},children:[s.icon,h.jsx("span",{className:"truncate",children:s.label}),f?s.active?s.direction==="asc"?h.jsx(F2,{className:"ml-auto h-3 w-3 shrink-0 text-chip-indigo-text"}):h.jsx(Xy,{className:"ml-auto h-3 w-3 shrink-0 text-chip-indigo-text"}):h.jsx(Dx,{className:"ml-auto h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-40 hover:opacity-40"}):d>0&&h.jsx(Dx,{className:"ml-auto h-3 w-3 shrink-0 opacity-40"}),s.canResize&&s.onResizeBy&&h.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize ${s.label} column`,"aria-valuemin":$r,"aria-valuemax":ls,"aria-valuenow":s.width??s.defaultWidth??es,"aria-valuetext":`${s.width??s.defaultWidth??es} pixels wide`,title:"Drag to resize; use arrow keys or click either side to adjust",tabIndex:0,onClick:p=>{var g;p.preventDefault(),p.stopPropagation();const x=u.current;if(u.current=!1,x)return;const y=p.currentTarget.getBoundingClientRect();(g=s.onResizeBy)==null||g.call(s,p.clientX{p.preventDefault(),p.stopPropagation();const x=p.currentTarget.parentElement;u.current=!1,a.current={pointerId:p.pointerId,startX:p.clientX,startWidth:s.width??(x==null?void 0:x.getBoundingClientRect().width)??s.defaultWidth??es,resizeTo:s.onResizeTo},p.currentTarget.setPointerCapture(p.pointerId)},onPointerMove:p=>{const x=a.current;if(!x||x.pointerId!==p.pointerId)return;const y=p.clientX-x.startX;Math.abs(y)>2&&(u.current=!0),x.resizeTo(x.startWidth+y)},onPointerUp:p=>{var x;((x=a.current)==null?void 0:x.pointerId)===p.pointerId&&(p.currentTarget.releasePointerCapture(p.pointerId),a.current=null,window.setTimeout(()=>{u.current=!1},0))},onPointerCancel:()=>{a.current=null,u.current=!1},onKeyDown:p=>{var x,y;p.stopPropagation(),p.key==="ArrowLeft"||p.key==="ArrowRight"?(p.preventDefault(),(x=s.onResizeBy)==null||x.call(s,p.key==="ArrowLeft"?-Yo:Yo)):(p.key==="Home"||p.key==="End")&&(p.preventDefault(),(y=s.onResizeTo)==null||y.call(s,p.key==="Home"?$r:ls))},className:"absolute inset-y-0 right-0 z-10 w-3 cursor-col-resize touch-none border-r border-transparent transition-colors hover:border-indigo-400 focus-visible:border-indigo-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500"})]},d)})})}const Wn=28,Vo=12,ed=500,$r=80,ls=960,es=160,Yo=24,Lx=44,Go={File:2,Path:3,FileName:1,Type:1,Version:1};function xk({files:n,totalCount:r,rawLoadedCount:a,onLoadMore:u,loadingMore:s=!1,scanning:d=!1,hasScanned:f=!1,activeDirectory:m="",recursive:p=!1,onDisableRecursive:x,onOpenDirectory:y,onOpenConfig:g,filterText:w,onClearFilter:v,prefilterNote:S,columnHeaders:T,columnNames:L,selectedIndex:D,onSelectIndex:$,onLaunch:I,onContextMenu:J,rowColors:ie,sort:U,onSortChange:R}){const Q=["File"],fe=L.length>0?L:Q,B=T.length>0?T:fe,ne=Array.from({length:Math.max(fe.length,B.length)},(ge,Me)=>({key:fe[Me]??Q[0],header:B[Me]??fe[Me]??Q[0]})),V=_.useRef(null),[se,ve]=_.useState(0),[ae,A]=_.useState(600),[W,le]=_.useState(0),[re,N]=_.useState({}),qe=_.useRef(null),Ge=_.useRef(!1),M=fe.reduce((ge,Me)=>ge+(Go[Me]??1),1),E=(ge,Me)=>{const Le=Math.min(ls,Math.max($r,Math.round(Me)));N(lt=>({...lt,[ge]:Le}))},Y=(ge,Me)=>{var K;const Le=Array.from(((K=V.current)==null?void 0:K.querySelectorAll("[data-column-key]"))??[]).find(ue=>ue.dataset.columnKey===ge),lt=re[ge]??(Le==null?void 0:Le.getBoundingClientRect().width)??es;E(ge,lt+Me)},oe=[`${Lx}px`,...fe.map(ge=>re[ge]?`${re[ge]}px`:`minmax(${$r}px, ${Go[ge]??1}fr)`)].join(" "),he=_.useRef(!1),je=_.useRef(null),ye=n.length,_e=a??ye,pe=r??_e,Se=_e{const ge=V.current;if(!ge)return;const Me=new ResizeObserver(Le=>{for(const lt of Le)A(lt.contentRect.height),le(lt.contentRect.width)});return Me.observe(ge),A(ge.clientHeight||600),le(ge.clientWidth||0),()=>Me.disconnect()},[]),_.useEffect(()=>{var ue;const ge=V.current;if(!ge||D<0||D>=ye)return;const Me=((ue=ge.querySelector("[data-file-list-header]"))==null?void 0:ue.offsetHeight)??0,Le=Me+D*Wn,lt=Le+Wn;let K=ge.scrollTop;Lege.scrollTop+ge.clientHeight&&(K=lt-ge.clientHeight),K!==ge.scrollTop&&(ge.scrollTop=K,ve(K))},[D,ye]),_.useEffect(()=>{const ge=V.current;if(!ge)return;const Me=()=>{if(he.current||!Bt||!u)return;const Le=ge.scrollTop+ge.clientHeight,lt=ye*Wn;lt-LeLe&&(he.current=!0,window.setTimeout(()=>{he.current=!1},200),u())};return ge.addEventListener("scroll",Me,{passive:!0}),window.addEventListener("scroll",Me,{passive:!0}),()=>{ge.removeEventListener("scroll",Me),window.removeEventListener("scroll",Me)}},[n,Bt,u,ye]),_.useEffect(()=>{if(he.current||!Bt||!u)return;const ge=ye*Wn,Me=se+ae;if(!(ge-MeMe))return;const lt=`${ye}:${_e}:${pe}`;je.current=lt,u()});const Gt=_.useCallback(ge=>{ve(ge.currentTarget.scrollTop)},[]),St=Math.max(0,Math.floor(se/Wn)-Vo),nt=Math.ceil(ae/Wn)+Vo*2,Je=Math.min(ye,St+nt),en=St*Wn,vn=(ge,Me)=>{if(Me)return{className:"bg-chip-indigo-bg border-l-4 border-chip-indigo-border text-ink",style:{}};for(const[Le,lt]of ie)if(ge.toLowerCase().includes(Le.toLowerCase()))return{className:"hover:bg-elevated border-l-4 text-ink",style:{borderLeftColor:lt,borderLeftWidth:"4px"}};return{className:"border-l-4 border-transparent text-ink-secondary hover:bg-elevated/60",style:{borderLeftColor:"transparent",borderLeftWidth:"4px"}}},tn=(Bt?ye+nt:ye)*Wn,Ht="btn btn-secondary px-3 py-1.5";return h.jsxs("div",{ref:V,onScroll:Gt,className:"flex-1 overflow-auto bg-app text-xs transition-colors duration-200 focus-visible:outline focus-visible:outline-2 focus-visible:outline-indigo-500 focus-visible:outline-offset-[-2px]","data-testid":"file-list","data-loaded-count":_e,"aria-busy":d,role:"grid","aria-label":"Discovered files","aria-rowcount":Math.max(pe,ye===0?1:0)+1,"aria-colcount":fe.length+1,"aria-activedescendant":ye>0?`file-row-${D}`:void 0,tabIndex:0,children:[h.jsx("div",{className:"sticky top-0 z-10",role:"presentation",children:h.jsx(gk,{columnTemplate:oe,resizePointerRef:qe,resizeMovedRef:Ge,items:[{label:"#",icon:h.jsx(wd,{className:"h-3.5 w-3.5"})},...ne.map(({key:ge,header:Me})=>({label:Me,weight:Go[ge]??1,width:re[ge],defaultWidth:Math.min(ls,Math.max($r,Math.round((W-Lx)*(Go[ge]??1)/M))),canResize:!0,onResizeBy:Le=>Y(ge,Le),onResizeTo:Le=>E(ge,Le),sortKey:ge,active:(U==null?void 0:U.column)===ge,direction:U==null?void 0:U.direction,onSort:()=>{(U==null?void 0:U.column)!==ge?R({column:ge,direction:"asc"}):U.direction==="asc"?R({column:ge,direction:"desc"}):R(null)}}))]})}),S&&ye>0&&h.jsxs("div",{role:"note","data-testid":"prefilter-note",className:"flex items-center gap-1.5 border-b border-line/40 bg-surface px-3 py-1 text-[11px] text-ink-faint",children:[h.jsx(Zy,{className:"h-3 w-3 shrink-0 text-ink-faint","aria-hidden":"true"}),h.jsx("span",{className:"min-w-0 truncate",children:S})]}),ye===0?h.jsx("div",{role:"row","aria-rowindex":2,"data-testid":"file-list-empty",children:h.jsx("div",{role:"gridcell","aria-colspan":fe.length+1,className:"p-8 text-center text-ink-faint",children:d?h.jsxs("div",{className:"flex flex-col items-center gap-2",children:[h.jsx(Wi,{className:"h-5 w-5 animate-spin text-chip-indigo-text motion-reduce:animate-none"}),h.jsx("span",{children:"Scanning files..."})]}):!m.trim()&&g?h.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h.jsx("span",{children:"Select a directory first."}),h.jsx("button",{type:"button",onClick:g,className:Ht,children:"Choose configuration"})]}):f?w.trim()?h.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h.jsxs("span",{children:["No files match “",w,"”."]}),h.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[h.jsx("button",{type:"button",onClick:v,className:Ht,children:"Clear filter"}),p&&x&&h.jsx("button",{type:"button",onClick:x,className:Ht,children:"Turn off recursive"}),y&&h.jsx("button",{type:"button",onClick:y,className:Ht,children:"Open directory"})]})]}):h.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h.jsx("span",{children:"No files found for the current directory and extension."}),h.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[p&&x&&h.jsx("button",{type:"button",onClick:x,className:Ht,children:"Turn off recursive"}),y&&h.jsx("button",{type:"button",onClick:y,className:Ht,children:"Open directory"})]})]}):h.jsx("span",{children:"Select a directory and scan to find files."})})}):h.jsxs("div",{className:"relative",style:{height:tn},role:"rowgroup",children:[s&&h.jsx("div",{className:"pointer-events-none absolute left-1/2 top-2 z-20 -translate-x-1/2","aria-hidden":"true",children:h.jsx(Wi,{className:"h-4 w-4 animate-spin text-chip-indigo-text"})}),h.jsx("div",{style:{transform:`translateY(${en}px)`},"data-testid":"file-list-window",role:"presentation",children:n.slice(St,Je).map((ge,Me)=>{const Le=St+Me,lt=Le===D,K=vn(ge.filename,lt);return h.jsxs("div",{id:`file-row-${Le}`,"data-row-index":Le,role:"row","aria-rowindex":Le+2,"aria-selected":lt,onClick:()=>{var ue;$(Le),(ue=V.current)==null||ue.focus()},onDoubleClick:()=>I(ge),onContextMenu:ue=>J(ue,ge,Le),className:`grid cursor-pointer items-center transition-colors ${K.className}`,style:{...K.style,height:Wn,gridTemplateColumns:oe},children:[h.jsxs("div",{className:"flex items-center justify-end gap-1 px-3 font-mono text-ink-faint",children:[ge.has_hook&&h.jsx("span",{title:ge.hook_pattern?`Launch workflow: ${ge.hook_pattern}`:"Launch workflow configured","aria-label":"Workflow hook attached",className:"inline-flex items-center text-status-warning-text hover:brightness-95",children:h.jsx(tb,{className:"h-3 w-3 shrink-0"})}),h.jsx("span",{className:"hidden sm:inline",children:Le+1})]}),fe.map((ue,ke)=>{const Ce=ge.column_values[ue]||(ue==="File"?ge.filename:"-");return h.jsx("div",{role:"gridcell","data-column-key":ue,className:"truncate px-3 font-mono",style:{minWidth:$r},title:ue==="Path"?ge.path:Ce,children:Ce},ke)})]},ge.path||Le)})}),Se&&h.jsxs("div",{className:"pointer-events-none absolute bottom-2 left-1/2 -translate-x-1/2 rounded-full border border-line bg-surface-strong px-3 py-1 text-[11px] text-ink-muted shadow","data-testid":"file-list-paging",children:[s?h.jsx(L2,{className:"mr-1.5 h-4 w-4 animate-spin motion-reduce:animate-none text-ink-muted"}):null,"(",_e," of ",pe," loaded)"]})]})]})}function Sd({id:n,ariaLabel:r,value:a,options:u,onChange:s,placeholder:d,className:f="",inputClassName:m="",optionLabel:p=y=>y,onOpenChange:x}){const y=_.useId(),g=_.useRef(null),[w,v]=_.useState(!1),[S,T]=_.useState(""),[L,D]=_.useState(-1),$=u.filter(R=>p(R).toLocaleLowerCase().includes(S.toLocaleLowerCase())),I=L>=0&&$[L]?`${y}-option-${L}`:void 0;_.useEffect(()=>{const R=Q=>{var fe;(fe=g.current)!=null&&fe.contains(Q.target)||v(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]),_.useEffect(()=>{x==null||x(w)},[w,x]),_.useEffect(()=>{var R;L<0||(R=document.getElementById(`${y}-option-${L}`))==null||R.scrollIntoView({block:"nearest"})},[L,y]);const J=()=>{T(""),D(-1),v(!0)},ie=R=>{s(R),T(""),D(-1),v(!1)},U=R=>{if(R.key==="ArrowDown"){if(R.preventDefault(),!w){J(),D(0);return}D(Q=>Math.min(Q+1,$.length-1))}else if(R.key==="ArrowUp"){if(R.preventDefault(),!w){J(),D($.length-1);return}D(Q=>Q<=0?$.length-1:Q-1)}else R.key==="Enter"&&w&&$[L]!==void 0?(R.preventDefault(),ie($[L])):R.key==="Escape"&&v(!1)};return h.jsxs("div",{ref:g,onBlur:R=>{var Q;(Q=g.current)!=null&&Q.contains(R.relatedTarget)||v(!1)},className:`relative flex min-w-0 ${f}`,children:[h.jsx("input",{id:n,type:"text",role:"combobox","aria-label":r,"aria-autocomplete":"list","aria-expanded":w,"aria-controls":y,"aria-activedescendant":I,value:a,placeholder:d,onChange:R=>{s(R.target.value),T(R.target.value),D(-1),v(!0)},onKeyDown:U,className:`min-w-0 flex-1 rounded-l-md border border-line bg-elevated px-3 py-1.5 text-ink outline-none transition-colors hover:bg-surface-strong focus:border-indigo-500 ${m}`}),h.jsx("button",{type:"button","aria-label":`Show ${r.toLowerCase()} options`,"aria-expanded":w,title:`Show ${r.toLowerCase()} options`,onMouseDown:R=>R.preventDefault(),onClick:()=>w?v(!1):J(),className:"shrink-0 rounded-r-md border border-l-0 border-line bg-elevated px-2 text-ink-muted hover:bg-surface-strong hover:text-ink focus-visible:z-10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-indigo-500 transition-colors",children:h.jsx(Z2,{className:`h-3.5 w-3.5 transition-transform ${w?"rotate-180":""}`})}),w&&h.jsx("ul",{id:y,role:"listbox","aria-label":`${r} options`,className:"absolute left-0 top-full z-[var(--z-combobox-list)] mt-1 max-h-60 w-full min-w-48 overflow-y-auto rounded-md border border-line bg-surface py-1 text-ink shadow-xl",children:$.length>0?$.map((R,Q)=>{const fe=p(R),B=Q===L,ne=R===a;return h.jsx("li",{id:`${y}-option-${Q}`,role:"option","aria-selected":ne,title:fe||void 0,onMouseEnter:()=>D(Q),onMouseDown:V=>V.preventDefault(),onClick:()=>ie(R),className:`cursor-pointer truncate px-3 py-1.5 ${B?"bg-elevated text-ink":"text-ink-secondary"} ${ne?"font-semibold":""}`,children:fe||"(No filter)"},`${R}-${Q}`)}):h.jsx("li",{className:"px-3 py-1.5 text-ink-muted",children:"No matching presets"})})]})}function yk({title:n,release:r,directories:a,activeDirectory:u,onDirectoryChange:s,onBrowseDirectory:d,onGoToParentDirectory:f,onGoToHomeDirectory:m,onOpenActiveDirectory:p,onOpenTerminal:x}){const[y,g]=_.useState(!1);return h.jsxs("header",{className:"relative z-30 flex flex-wrap items-center gap-3 border-b border-line bg-app/90 px-5 py-2 text-xs backdrop-blur-xl shadow-xs transition-all duration-200",children:[h.jsx("div",{className:"flex shrink-0 items-center gap-3",children:h.jsxs("div",{className:"flex items-center gap-3.5",children:[h.jsxs("div",{className:"relative flex h-9 w-9 items-center justify-center rounded-xl bg-gradient-to-br from-chip-indigo-bg to-chip-purple-bg text-chip-indigo-text border border-chip-indigo-border shadow-xs",children:[h.jsx(kd,{className:"h-4 w-4"}),h.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 flex h-2.5 w-2.5 items-center justify-center rounded-full bg-emerald-500 ring-2 ring-app"})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h1",{className:"text-sm font-bold tracking-tight text-ink font-heading",children:"ProFiles"}),n&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-ink-faint",children:"/"}),h.jsx("span",{className:"text-xs font-medium text-chip-indigo-text bg-chip-indigo-bg px-2 py-0.5 rounded-md border border-chip-indigo-border/50",children:n})]})]}),h.jsxs("p",{className:"text-[11px] font-medium text-ink-muted tracking-wide mt-0.5",children:["Crafted by ",h.jsx("span",{className:"text-ink font-semibold",children:"Florent ALBANY"})," • ",h.jsxs("span",{className:"font-mono text-chip-indigo-text",children:["v",r||"0.11.0-rc.2"]})]})]})]})}),h.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[h.jsxs("label",{className:"flex shrink-0 items-center gap-1.5 font-medium text-ink-secondary text-xs",children:[h.jsx(ss,{className:"h-3.5 w-3.5 text-chip-indigo-text"}),h.jsx("span",{children:"Directory:"})]}),h.jsx(He,{text:"Select or type a directory path to scan files from.",suppress:y,children:h.jsx(Sd,{id:"directory-combobox",ariaLabel:"Directory",value:u,options:a,onChange:s,onOpenChange:g,placeholder:"/path/to/directory",className:"w-full",inputClassName:"font-mono"})}),p&&h.jsx(He,{text:"Open the active directory in the OS file manager",block:!1,children:h.jsx("button",{type:"button",onClick:p,"aria-label":"Open active directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(B2,{className:"h-3.5 w-3.5"})})}),f&&h.jsx(He,{text:"Go to parent directory",block:!1,children:h.jsx("button",{type:"button",onClick:f,"aria-label":"Go to parent directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Vd,{className:"h-3.5 w-3.5 rotate-180"})})}),d&&h.jsx(He,{text:"Browse for a folder on this system",block:!1,children:h.jsx("button",{type:"button",onClick:d,"aria-label":"Browse directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Ji,{className:"h-3.5 w-3.5"})})}),x&&h.jsx(He,{text:"Open the active directory in a terminal",block:!1,children:h.jsx("button",{type:"button",onClick:()=>x(u),"aria-label":"Open directory in terminal",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(kd,{className:"h-3.5 w-3.5"})})}),m&&h.jsx(He,{text:"Set directory to your home folder",block:!1,children:h.jsx("button",{type:"button",onClick:m,"aria-label":"Go to home directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Yd,{className:"h-3.5 w-3.5"})})})]})]})}function bk({message:n,onRetry:r,retrying:a=!1}){return h.jsx("div",{className:"flex flex-1 items-center justify-center p-8",role:"alert","data-testid":"init-error-panel",children:h.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-line bg-surface p-6 text-center shadow-xl",children:[h.jsx("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-full border border-status-danger-border bg-status-danger-bg",children:h.jsx(lu,{className:"h-5 w-5 text-status-danger-text/80"})}),h.jsx("h3",{className:"text-sm font-semibold text-ink",children:"Couldn't load the app"}),h.jsx("p",{className:"mt-1 break-words text-xs text-ink-secondary",children:n}),h.jsxs("button",{type:"button",onClick:r,disabled:a,className:"btn btn-primary mx-auto mt-4 px-3.5 py-1.5 font-semibold shadow-sm",children:[h.jsx(cs,{className:`h-3.5 w-3.5 ${a?"animate-spin motion-reduce:animate-none":""}`}),h.jsx("span",{children:a?"Retrying...":"Retry"})]})]})})}const Ux=/"([^"]*)"|(\S+)/g,Bx=/"([^"]*)"/g,vk="Unmatched quote";function wk(n){const r=[];let a;for(Ux.lastIndex=0;(a=Ux.exec(n))!==null;){const f=a[1]!==void 0?a[1]:a[2];f&&f.trim()&&r.push(f)}let u="",s=0;Bx.lastIndex=0;let d;for(;(d=Bx.exec(n))!==null;)u+=n.slice(s,d.index),s=d.index+d[0].length;return u+=n.slice(s),{terms:r,error:u.includes('"')?vk:null}}function nb(n){const r=n.trim();if(!r)return{error:null,groups:[]};const{terms:a,error:u}=wk(r);if(a.length===0)return{error:u,groups:[]};const s=[];let d={includes:[],excludes:[]};for(const f of a){if(f.toUpperCase()==="OR"){s.push(d),d={includes:[],excludes:[]};continue}f==="-"||f==="+"||(f.startsWith("-")&&f.length>1?d.excludes.push(f.slice(1)):f.startsWith("+")&&f.length>1?d.includes.push(f.slice(1)):d.includes.push(f))}return s.push(d),{error:u,groups:s}}const kk=256,Ki=new Map;function Hx(n){return n.toLowerCase()}function Sk(n){const r=Ki.get(n);if(r)return Ki.delete(n),Ki.set(n,r),r;const{groups:a}=nb(n),u={groups:a.map(s=>({includes:s.includes.map(Hx),excludes:s.excludes.map(Hx)}))};if(Ki.size>=kk){const s=Ki.keys().next().value;s!==void 0&&Ki.delete(s)}return Ki.set(n,u),u}function Nk(n,r){return r.includes.every(a=>n.includes(a))&&!r.excludes.some(a=>n.includes(a))}function Ek(n,r){const{groups:a}=Sk(r);if(a.length===0)return!0;const u=n.toLowerCase();return a.some(s=>Nk(u,s))}function jk({query:n,visible:r}){if(!r)return null;const a=nb(n);return a.error?h.jsx("div",{"data-testid":"filter-syntax-helper",className:"pointer-events-none absolute left-0 right-0 top-full z-[var(--z-syntax-helper)] mt-1 rounded-md border border-status-danger-border bg-surface-strong px-3 py-2 text-[11px] leading-5 text-status-danger-text/90 shadow-xl",children:a.error}):a.groups.length===0?null:h.jsxs("div",{"data-testid":"filter-syntax-helper",className:"pointer-events-none absolute left-0 right-0 top-full z-[var(--z-syntax-helper)] mt-1 rounded-md border border-line bg-surface-strong px-3 py-2 text-[11px] leading-5 text-ink-secondary shadow-xl",children:[h.jsx("span",{className:"mr-1.5 align-[1px] text-[10px] uppercase tracking-wide text-ink-muted",children:"reads as"}),a.groups.map((u,s)=>h.jsxs("span",{"data-testid":"filter-syntax-group",children:[s>0&&h.jsx("span",{className:"mx-1 font-mono text-chip-indigo-text",children:"OR"}),u.includes.map((d,f)=>h.jsxs("span",{children:[f>0&&h.jsx("span",{className:"text-ink-muted",children:" · "}),h.jsx("span",{className:"font-mono text-chip-indigo-text",children:d})]},`i-${f}`)),u.includes.length>0&&u.excludes.length>0&&h.jsx("span",{className:"text-ink-muted",children:" · "}),u.excludes.map((d,f)=>h.jsxs("span",{children:[f>0&&h.jsx("span",{className:"text-ink-muted",children:" · "}),h.jsx("span",{className:"text-ink-muted",children:"✕ "}),h.jsx("span",{className:"font-mono text-status-danger-text/70 line-through",children:d})]},`x-${f}`))]},s))]})}const qx=h.jsxs("span",{className:"flex flex-col gap-1 whitespace-nowrap text-left",children:[h.jsx("span",{className:"font-semibold",children:"Supported operators"}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"a b"})," — AND (both terms)"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"a OR b"})," — either term"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"-a"})," — NOT (exclude)"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"+a"})," — force include"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:'"a b"'})," — exact phrase"]})]});function Ck({extensions:n,activeExtension:r,onExtensionChange:a,filterOptions:u,filterText:s,onFilterTextChange:d,recursive:f,onRecursiveChange:m,onScan:p,scanning:x,barcodeMode:y,onBarcodeToggle:g,onCameraBarcodeClick:w,autoRescanActive:v,onTimerClick:S}){const[T,L]=_.useState(!1),[D,$]=_.useState(!1),[I,J]=_.useState(!1);return h.jsxs("div",{className:"flex w-full flex-wrap items-center gap-3 border-b border-line bg-surface-glass p-3 text-xs",children:[h.jsx(He,{text:qx,suppress:D,children:h.jsxs("div",{className:"relative min-w-0 flex-1 basis-64",onFocusCapture:ie=>{ie.target.tagName==="INPUT"&&L(!0)},onBlurCapture:ie=>{ie.target.tagName==="INPUT"&&L(!1)},children:[h.jsx(Jy,{className:"pointer-events-none absolute left-3 top-1/2 z-10 h-4 w-4 -translate-y-1/2 text-ink-secondary"}),h.jsx(Sd,{id:"filter-combobox",ariaLabel:"File filter",value:s,options:u||[],onChange:d,onOpenChange:$,placeholder:"Filter files: keyword, a OR b, -tag, exact phrase...",className:"w-full",inputClassName:"pl-9 pr-3",optionLabel:ie=>ie||"(No filter)"}),h.jsx(jk,{query:s,visible:T&&!D&&s.trim().length>0})]})}),h.jsx(He,{text:qx,block:!1,suppress:I,children:h.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[h.jsx("span",{className:"text-ink-muted",children:"Ext:"}),h.jsx(Sd,{id:"extension-combobox",ariaLabel:"Extension filter",value:r,options:n,onChange:a,onOpenChange:J,placeholder:".py OR .toml",className:"w-44",inputClassName:"font-mono px-2.5"})]})}),h.jsx(He,{text:"Include subdirectories when scanning",block:!1,children:h.jsxs("label",{className:"flex shrink-0 cursor-pointer select-none items-center gap-1.5 text-ink-secondary",children:[h.jsx("input",{type:"checkbox",checked:f,onChange:ie=>m(ie.target.checked),className:"rounded border-line text-chip-indigo-text focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-1 focus-visible:ring-offset-app"}),h.jsx("span",{children:"Recursive"})]})}),h.jsx(He,{text:"Run the scan with the current criteria (Enter)",block:!1,children:h.jsxs("button",{onClick:p,disabled:x,className:"btn btn-primary shrink-0 px-3.5 py-1.5 font-semibold shadow-sm",children:[x?h.jsx(cs,{className:"h-3.5 w-3.5 animate-spin motion-reduce:animate-none"}):h.jsx(er,{className:"h-3.5 w-3.5 fill-current"}),h.jsx("span",{children:x?"Scanning...":"Scan"})]})}),h.jsx(He,{text:v?"Auto-rescan is active. Click to configure.":"Configure periodic auto-rescan (hot-folder mode)",block:!1,children:h.jsx("button",{type:"button",onClick:S,"aria-label":"Configure timer / auto-rescan",className:`flex shrink-0 items-center justify-center rounded-md border p-1.5 text-ink-secondary hover:border-indigo-500 hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 transition-colors ${v?"border-chip-indigo-border bg-chip-indigo-bg text-chip-indigo-text":"border-line bg-elevated"}`,children:h.jsx(Py,{className:`h-3.5 w-3.5 ${v?"animate-pulse":""}`})})}),h.jsx(He,{text:"Toggle barcode scanner mode (USB HID). When active, scan a barcode to auto-fill controls and trigger a scan.",block:!1,children:h.jsx("button",{type:"button",onClick:g,"aria-label":y?"Disable barcode mode":"Enable barcode mode",className:`flex shrink-0 items-center justify-center rounded-md border p-1.5 text-ink-secondary hover:border-indigo-500 hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 transition-colors ${y?"border-chip-indigo-border bg-chip-indigo-bg text-chip-indigo-text":"border-line bg-elevated"}`,children:h.jsx(Gd,{className:`h-3.5 w-3.5 ${y?"animate-pulse":""}`})})}),w&&h.jsx(He,{text:"Scan barcode or QR code using webcam / camera (Ctrl + Shift + B)",block:!1,children:h.jsx("button",{type:"button",onClick:w,"aria-label":"Scan barcode with camera",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Iy,{className:"h-3.5 w-3.5"})})})]})}const Tk=2e3,_k=500,Ak=[{value:null,label:"ALL"},{value:"DEBUG",label:"DEBUG"},{value:"INFO",label:"INFO"},{value:"WARNING",label:"WARNING"},{value:"ERROR",label:"ERROR"},{value:"CRITICAL",label:"CRITICAL"}],Fx={DEBUG:{icon:Y2,className:"text-chip-sky-text"},INFO:{icon:Zy,className:"text-status-success-text"},WARNING:{icon:eb,className:"text-status-warning-text"},ERROR:{icon:bd,className:"text-status-danger-text"},CRITICAL:{icon:bd,className:"text-status-danger-text"},UNKNOWN:{icon:Pr,className:"text-ink-faint"}};function zk({isOpen:n,onClose:r,onOpenExternally:a}){const[u,s]=_.useState([]),[d,f]=_.useState("profiles.log"),[m,p]=_.useState(0),[x,y]=_.useState(null),[g,w]=_.useState(""),[v,S]=_.useState(!1),[T,L]=_.useState(!0),[D,$]=_.useState(null),[I,J]=_.useState(!0),ie=_.useRef(null),U=_.useRef(null),R=_.useRef(null),Q=_.useRef(null),fe=_.useRef(T),B=_.useRef({level:x,search:g});fe.current=T,B.current={level:x,search:g};const ne=_.useCallback(async()=>{const{level:A,search:W}=B.current;S(!0);try{const le=await s2({limit:_k,level:A,search:W});s(le.entries),f(le.path),p(le.size_bytes),$(null)}catch(le){$((le==null?void 0:le.message)||"Failed to read the log file")}finally{S(!1)}},[]);_.useEffect(()=>{n&&ne()},[n,ne]),_.useEffect(()=>{if(!n||!T)return;const A=window.setInterval(()=>{ne()},Tk);return()=>window.clearInterval(A)},[n,T,ne]),_.useEffect(()=>{if(!n)return;const A=window.setTimeout(()=>void ne(),250);return()=>window.clearTimeout(A)},[n,x,g,ne]),_.useEffect(()=>{if(!I)return;const A=R.current;A&&(A.scrollTop=A.scrollHeight)},[u,I]),_.useEffect(()=>{if(!n)return;const A=document.activeElement instanceof HTMLElement?document.activeElement:null,W=requestAnimationFrame(()=>{var le;return(le=U.current)==null?void 0:le.focus()});return()=>{cancelAnimationFrame(W),A==null||A.focus()}},[n]);const V=A=>{var N;if(A.key==="Escape"){A.preventDefault(),r();return}if(A.key!=="Tab")return;const W=(N=ie.current)==null?void 0:N.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(!(W!=null&&W.length))return;const le=W[0],re=W[W.length-1];A.shiftKey&&document.activeElement===le?(A.preventDefault(),re.focus()):!A.shiftKey&&document.activeElement===re&&(A.preventDefault(),le.focus())},se=()=>{const A=R.current;if(!A)return;const W=A.scrollHeight-A.scrollTop-A.clientHeight<24;J(W)},ve=async()=>{try{await navigator.clipboard.writeText(u.map(A=>A.raw).join(` +`))}catch{}},ae=_.useMemo(()=>{const A=new Map;for(const W of u)A.set(W.level,(A.get(W.level)??0)+1);return A},[u]);return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/65 p-3 backdrop-blur-sm sm:p-6",onClick:r,children:h.jsxs("div",{ref:ie,role:"dialog","aria-modal":"true","aria-labelledby":"log-viewer-title",onKeyDown:V,className:"animate-modal-in flex h-[min(84dvh,760px)] w-[clamp(560px,85vw,1500px)] min-h-0 flex-col overflow-hidden rounded-xl border border-frame-line glass-panel sm:rounded-2xl",onClick:A=>A.stopPropagation(),children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-b border-line px-5 py-4 sm:px-6",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[h.jsx("span",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Pr,{className:"h-5 w-5 text-chip-indigo-text","aria-hidden":"true"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{id:"log-viewer-title",className:"text-base font-semibold text-ink",children:"Application logs"}),h.jsxs("p",{className:"truncate font-mono text-xs text-ink-muted",children:[d,h.jsxs("span",{className:"text-ink-faint",children:[" · ",Vx(m)]})]})]})]}),h.jsxs("div",{className:"relative min-w-[220px] flex-1",children:[h.jsx(Jy,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ink-faint","aria-hidden":"true"}),h.jsx("input",{ref:Q,type:"search",value:g,onChange:A=>w(A.target.value),placeholder:"Filter log lines…","aria-label":"Filter log lines",className:"w-full rounded-lg border border-line bg-elevated py-1.5 pl-8 pr-2.5 font-mono text-xs text-ink placeholder:text-ink-faint focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400"})]}),h.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[h.jsx(He,{text:T?"Pause live tail":"Resume live tail",block:!1,children:h.jsxs("button",{type:"button",onClick:()=>L(A=>!A),"aria-pressed":T,className:`flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400 ${T?"border-status-success-border bg-status-success-bg text-status-success-text":"border-line bg-elevated text-ink-muted hover:text-ink"}`,children:[h.jsx("span",{className:`h-2 w-2 rounded-full ${T?"bg-emerald-400":"bg-ink-faint"}`,"aria-hidden":"true"}),T?"Live":"Paused"]})}),h.jsx(He,{text:"Refresh now",block:!1,children:h.jsx("button",{type:"button",onClick:()=>void ne(),disabled:v,className:"rounded-lg border border-line bg-elevated p-2 text-ink-muted hover:text-ink disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(cs,{className:`h-4 w-4 ${v?"animate-spin":""}`,"aria-hidden":"true"})})}),h.jsx(He,{text:"Copy visible lines",block:!1,children:h.jsx("button",{type:"button",onClick:()=>void ve(),disabled:u.length===0,className:"rounded-lg border border-line bg-elevated p-2 text-ink-muted hover:text-ink disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(yn,{className:"h-4 w-4","aria-hidden":"true"})})}),h.jsx(He,{text:"Open log file in the default application",block:!1,children:h.jsx("button",{type:"button",onClick:()=>{a==null||a(),r()},className:"rounded-lg border border-line bg-elevated p-2 text-ink-muted hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(sw,{className:"h-4 w-4","aria-hidden":"true"})})}),h.jsx(He,{text:"Close",block:!1,children:h.jsx("button",{ref:U,type:"button",onClick:r,className:"rounded-lg p-2 text-ink-muted hover:bg-hover-surface hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(nl,{className:"h-4 w-4","aria-hidden":"true"})})})]})]}),h.jsxs("div",{ref:R,onScroll:se,className:"min-h-0 flex-1 overflow-y-auto overscroll-contain bg-app px-2 py-2 font-mono text-xs leading-relaxed sm:px-3",children:[h.jsxs("div",{className:"sticky top-0 z-10 mb-1 flex items-center gap-2 rounded-md border border-line/40 bg-surface/60 px-2 py-1 text-[10px] font-bold uppercase tracking-wider text-ink-muted shadow-sm backdrop-blur-md",role:"row",children:[h.jsx("span",{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),h.jsx("span",{className:"w-[138px] shrink-0 text-ink/70",children:"Time"}),h.jsx("span",{className:"w-[52px] shrink-0 text-ink/70",children:"Level"}),h.jsx("span",{className:"w-[150px] shrink-0 text-ink/70",children:"Source"}),h.jsx("span",{className:"min-w-0 flex-1 text-ink/70",children:"Message"})]}),D&&h.jsx("p",{role:"alert",className:"px-3 py-6 text-center text-xs text-status-danger-text",children:D}),!D&&u.length===0&&!v&&h.jsx("p",{className:"px-3 py-6 text-center text-xs text-ink-faint",children:"No log entries match the current filters."}),h.jsx("ul",{className:"space-y-0.5",children:u.map((A,W)=>{const le=Fx[A.level]??Fx.UNKNOWN,re=le.icon,N=A.level==="ERROR"||A.level==="CRITICAL";return h.jsxs("li",{className:`group flex items-start gap-2 rounded px-2 py-1 ${N?"bg-status-danger-bg/40":"hover:bg-elevated/50"}`,children:[h.jsx("span",{className:le.className,children:h.jsx(re,{className:"mt-0.5 h-3.5 w-3.5","aria-hidden":"true"})}),h.jsx("span",{className:"w-[138px] shrink-0 text-ink-faint",children:A.timestamp}),h.jsx("span",{className:`w-[52px] shrink-0 text-[10px] font-semibold ${le.className}`,children:A.level}),h.jsx("span",{className:"w-[150px] shrink-0 truncate text-ink-faint",title:A.source,children:A.source}),h.jsx("span",{className:"min-w-0 flex-1 break-words text-ink-secondary",children:A.message})]},`${W}-${A.raw}`)})})]}),h.jsx("div",{className:"border-t border-line/60 bg-elevated/50 px-5 py-2.5 text-[11px] text-ink-faint shadow-sm backdrop-blur-md sm:px-6",children:h.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[h.jsx("span",{className:"mr-auto min-w-0 max-w-full basis-full truncate sm:basis-auto",role:"status","aria-atomic":"true",children:v&&u.length===0?"Loading log entries…":`${u.length} of ${Vx(m)} shown`}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"flex overflow-hidden rounded-lg border border-line/60 text-[11px] backdrop-blur-sm",role:"group","aria-label":"Filter by log level",children:Ak.map(A=>{const W=x===A.value,le=A.value?ae.get(A.value)??0:u.length;return h.jsxs("button",{type:"button",onClick:()=>y(A.value),"aria-pressed":W,title:A.value?`Show ${A.value} and above`:"Show all levels",className:`flex items-center gap-1 px-2.5 py-1 font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-400 ${W?"bg-indigo-600 text-white":"text-ink-muted hover:bg-elevated hover:text-ink"}`,children:[A.label,h.jsx("span",{className:W?"text-chip-indigo-text":"text-ink-faint",children:le})]},A.label)})}),h.jsx(He,{text:"Scroll to the newest entry",block:!1,children:h.jsxs("button",{type:"button",onClick:()=>J(!0),"aria-pressed":I,className:`flex items-center gap-1.5 rounded-lg border px-2.5 py-1 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400 ${I?"border-chip-indigo-border bg-chip-indigo-bg text-chip-indigo-text":"border-line bg-elevated text-ink-muted hover:text-ink"}`,children:[h.jsx(Xy,{className:"h-3.5 w-3.5","aria-hidden":"true"}),h.jsx("span",{className:"hidden sm:inline",children:"Follow tail"})]})})]}),h.jsxs("span",{className:"hidden items-center gap-1.5 lg:flex",children:[h.jsx("span",{className:"hidden sm:inline",children:"Ctrl + Shift + L"}),h.jsx("span",{children:"opens externally"})]})]})})]})}):null}function Vx(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}const Yx='button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], video[tabindex], [tabindex]:not([tabindex="-1"])';function Wr({isOpen:n,onClose:r,dialogRef:a,initialFocusRef:u}){return _.useEffect(()=>{if(!n)return;const s=document.activeElement instanceof HTMLElement?document.activeElement:null,d=requestAnimationFrame(()=>{var p;const m=(u==null?void 0:u.current)??((p=a.current)==null?void 0:p.querySelector(Yx))??a.current;m==null||m.focus()}),f=m=>{if(m.key!=="Tab")return;const p=a.current;if(!p)return;const x=Array.from(p.querySelectorAll(Yx));if(!x.length)return;const y=x[0],g=x[x.length-1],w=document.activeElement;if(!(w instanceof Node&&p.contains(w))){m.preventDefault(),(m.shiftKey?g:y).focus();return}m.shiftKey&&(w===y||w===p)?(m.preventDefault(),g.focus()):!m.shiftKey&&(w===g||w===p)&&(m.preventDefault(),y.focus())};return window.addEventListener("keydown",f,!0),()=>{cancelAnimationFrame(d),s==null||s.focus(),window.removeEventListener("keydown",f,!0)}},[n]),s=>{s.key==="Escape"&&(s.preventDefault(),s.stopPropagation(),r())}}function Dk({isOpen:n,onClose:r}){const a=_.useRef(null),u=Wr({isOpen:n,onClose:r,dialogRef:a});if(!n)return null;const s=[{key:"F5",desc:"Refresh / re-scan file list"},{key:"Ctrl + R",desc:"Reload configuration & scan"},{key:"Enter",desc:"Execute / launch selected file"},{key:"P",desc:"Open properties for selected file"},{key:"↑ / ↓",desc:"Navigate file list"},{key:"Home / End",desc:"Jump to first / last file"},{key:"PageUp / PageDown",desc:"Page through the file list"},{key:"Ctrl + D",desc:"Focus Directory field"},{key:"Ctrl + E",desc:"Focus Extension field"},{key:"Ctrl + F",desc:"Focus Filter / Search field"},{key:"Ctrl + L",desc:"Focus File List"},{key:"Ctrl + Shift + L",desc:"Open the log viewer"},{key:"Ctrl + ,",desc:"Open config file"},{key:"Ctrl + Shift + T",desc:"Toggle theme (Dark / Light)"},{key:"Ctrl + B",desc:"Toggle barcode scanner mode"},{key:"Ctrl + Shift + B",desc:"Open webcam / camera barcode scanner"},{key:"Ctrl + T",desc:"Open auto-rescan timer modal"},{key:"Ctrl + H",desc:"Set directory to home folder"},{key:"? or Ctrl + /",desc:"Show keyboard shortcuts"},{key:"Y / S / N",desc:"Answer workflow guard: Yes / Skip / No (prompt open)"},{key:"Enter",desc:"Confirm active workflow prompt (prompt open)"},{key:"Escape",desc:"Close dialogs / context menu"}];return h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",children:h.jsxs("div",{ref:a,role:"dialog","aria-modal":"true","aria-label":"Keyboard Shortcuts",onKeyDown:u,className:"animate-modal-in w-[450px] max-w-full rounded-2xl border border-frame-line glass-panel p-5",children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink",children:[h.jsx($y,{className:"h-5 w-5 text-chip-indigo-text"}),h.jsx("span",{children:"Keyboard Shortcuts"})]}),h.jsx("button",{onClick:r,className:"focus-ring rounded-lg p-1 text-ink-muted hover:bg-elevated hover:text-ink",children:h.jsx(nl,{className:"h-4 w-4"})})]}),h.jsx("div",{className:"max-h-[60vh] space-y-2 overflow-y-auto pr-1 text-xs",children:s.map(({key:d,desc:f})=>h.jsxs("div",{className:"flex items-center justify-between rounded-lg bg-elevated/50 px-3 py-2",children:[h.jsx("span",{className:"text-ink-secondary",children:f}),h.jsx("kbd",{className:"rounded bg-app px-2 py-0.5 font-mono text-[11px] font-semibold text-chip-indigo-text border border-line",children:d})]},d))}),h.jsx("div",{className:"mt-5 flex justify-end",children:h.jsx("button",{onClick:r,className:"btn btn-primary rounded-lg px-4 py-2 font-semibold",children:"Close"})})]})})}function Mk({isOpen:n,activeConfigPath:r,configExists:a=!0,onClose:u,onLoaded:s}){const[d,f]=_.useState(null),[m,p]=_.useState(""),[x,y]=_.useState(null),[g,w]=_.useState(!1),[v,S]=_.useState(null),T=_.useRef(null),L=_.useRef(null),D=_.useRef(null),$=a===!1;_.useEffect(()=>{var ne;if(!n){(ne=D.current)==null||ne.focus();return}D.current=document.activeElement instanceof HTMLElement?document.activeElement:null,S(null);const R=r??"",Q=Math.max(R.lastIndexOf("/"),R.lastIndexOf("\\")),fe=Q>0?R.slice(0,Q):"";I(fe);const B=requestAnimationFrame(()=>{var V;return(V=L.current)==null?void 0:V.focus()});return()=>{var V;cancelAnimationFrame(B),(V=D.current)==null||V.focus()}},[n,r]);const I=async R=>{w(!0),S(null);try{const Q=await g2(R);f(Q),p(Q.current_path),r&&Q.items.some(fe=>fe.path===r)?y(r):y(null)}catch(Q){S(Q.message||"Navigation failed")}finally{w(!1)}},J=R=>{var ne;if(R.key==="Escape"){R.preventDefault(),u();return}if(R.key!=="Tab")return;const Q=(ne=T.current)==null?void 0:ne.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(!(Q!=null&&Q.length))return;const fe=Q[0],B=Q[Q.length-1];R.shiftKey&&document.activeElement===fe?(R.preventDefault(),B.focus()):!R.shiftKey&&document.activeElement===B&&(R.preventDefault(),fe.focus())},ie=async()=>{var Q;const R=x||(((Q=d==null?void 0:d.items.find(fe=>fe.is_config))==null?void 0:Q.path)??null);if(!R){S("Select a configuration file to load.");return}try{w(!0);const fe=await d2(R);s(fe),u()}catch(fe){S(fe.message||"Unable to load configuration")}finally{w(!1)}},U=async()=>{const R=(m||(d==null?void 0:d.current_path)||"").trim();if(!R){S("Choose a directory before creating a configuration.");return}try{w(!0);const Q=await p2(R);s(Q),u()}catch(Q){S(Q.message||"Unable to create configuration")}finally{w(!1)}};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/65 p-3 backdrop-blur-sm sm:p-6",onClick:u,children:h.jsxs("div",{ref:T,role:"dialog","aria-modal":"true","aria-labelledby":"load-config-title",onKeyDown:J,className:"animate-modal-in flex h-[min(84dvh,760px)] max-h-[calc(100dvh-1.5rem)] w-[min(94vw,960px)] min-h-0 flex-col overflow-hidden rounded-xl border border-frame-line glass-panel sm:rounded-2xl",onClick:R=>R.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-line px-4 py-3 sm:px-5",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Kr,{className:"h-5 w-5 text-chip-indigo-text"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{id:"load-config-title",className:"text-sm font-semibold text-ink",children:$?"Create configuration":"Load configuration"}),h.jsx("p",{className:"truncate font-mono text-xs text-ink-muted",children:(d==null?void 0:d.current_path)||""})]})]}),h.jsx(He,{text:"Close",block:!1,children:h.jsx("button",{type:"button",onClick:u,"aria-label":"Close configuration modal",className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg text-ink-muted transition-colors hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(nl,{className:"h-4 w-4"})})})]}),$&&h.jsx("div",{className:"border-b border-line bg-chip-indigo-bg/20 px-4 py-3 text-xs text-ink-secondary",children:"No configuration file was found. Create one here?"}),h.jsxs("div",{className:"border-b border-line px-4 py-3 sm:px-5",children:[h.jsx("label",{htmlFor:"config-path-input",className:"mb-1.5 block text-xs font-medium text-ink-secondary",children:"Configuration directory"}),h.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[h.jsx("input",{ref:L,id:"config-path-input",type:"text",value:m,onChange:R=>p(R.target.value),onKeyDown:R=>{R.key==="Enter"&&I(m.trim())},placeholder:"/path/to/directory",className:"h-10 min-w-0 flex-1 rounded-lg border border-line bg-elevated px-2.5 font-mono text-sm text-ink outline-none placeholder:text-ink-faint transition-colors hover:bg-surface-strong focus-visible:border-indigo-500 focus-visible:ring-2 focus-visible:ring-indigo-500/30"}),h.jsx("button",{type:"button",onClick:()=>I(m.trim()),className:"inline-flex h-10 shrink-0 items-center gap-1.5 rounded-lg border border-line bg-elevated px-3.5 text-sm font-medium text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Go"}),h.jsx(He,{text:"Home directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>I(""),"aria-label":"Home directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Yd,{className:"h-4 w-4"})})}),(d==null?void 0:d.parent_path)&&h.jsx(He,{text:"Parent directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>I(d.parent_path),"aria-label":"Parent directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Vd,{className:"h-4 w-4 rotate-180"})})})]})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 py-2 sm:px-3 sm:py-3","aria-busy":g,children:g?h.jsxs("div",{className:"flex h-full items-center justify-center gap-2.5 text-sm text-ink-muted",children:[h.jsx(Wi,{className:"h-5 w-5 animate-spin text-chip-indigo-text"}),h.jsx("span",{role:"status",children:"Loading configuration files…"})]}):v?h.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-2.5 text-center",children:[h.jsx("p",{className:"text-sm text-status-danger-text",children:v}),h.jsx("button",{type:"button",onClick:()=>I(m||(d==null?void 0:d.current_path)||""),className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Retry"})]}):h.jsxs("ul",{className:"space-y-1",children:[d==null?void 0:d.items.map(R=>{if(R.is_dir)return h.jsx("li",{children:h.jsx("button",{onClick:()=>I(R.path),onDoubleClick:()=>I(R.path),className:"flex w-full items-center justify-between rounded-md px-3 py-1.5 text-left text-xs text-ink-secondary hover:bg-elevated",children:h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(ss,{className:"h-3.5 w-3.5 text-chip-indigo-text"}),R.name]})})},R.path);const Q=x===R.path;return h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>y(R.path),"aria-pressed":Q,className:`flex w-full items-center justify-between rounded-lg px-3 py-1.5 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-400 ${Q?"bg-chip-indigo-bg text-chip-indigo-text":"text-ink-secondary hover:bg-elevated hover:text-ink"}`,children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx(Pr,{className:"h-5 w-5 shrink-0 text-chip-amber-text"}),h.jsx("span",{className:"truncate",children:R.name})]}),R.is_config&&h.jsx(Kr,{className:"h-4 w-4 shrink-0 text-chip-indigo-text"}),Q&&h.jsx(vi,{className:"h-4 w-4 shrink-0 text-chip-indigo-text"})]})},R.path)}),(d==null?void 0:d.items.filter(R=>R.is_config).length)===0&&h.jsxs("li",{className:"flex h-full min-h-36 flex-col items-center justify-center gap-2.5 text-center text-sm text-ink-muted",children:[h.jsx(Pr,{className:"h-7 w-7 text-ink-faint"}),"No configuration files found"]})]})}),h.jsxs("div",{className:"flex flex-col gap-2 border-t border-line px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"mb-0.5 text-xs font-medium text-ink-muted",children:"Selected file"}),h.jsx("p",{className:"truncate font-mono text-sm text-ink",title:x||m,children:x||m||"—"})]}),h.jsxs("div",{className:"flex shrink-0 justify-end gap-1.5",children:[h.jsx("button",{type:"button",onClick:u,className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Cancel"}),$?h.jsxs("button",{type:"button",onClick:U,disabled:!m.trim(),className:"btn btn-primary min-h-10 rounded-lg px-4 text-sm font-semibold",children:[h.jsx(Kr,{className:"h-4 w-4"}),"Create configuration"]}):h.jsxs("button",{type:"button",onClick:ie,disabled:!x,className:"btn btn-primary min-h-10 rounded-lg px-4 text-sm font-semibold",children:[h.jsx(Kr,{className:"h-4 w-4"}),"Load configuration"]})]})]})]})}):null}function lb({isOpen:n,onClose:r,initialFilePath:a,md5:u}){const[s,d]=_.useState(null),[f,m]=_.useState(""),[p,x]=_.useState([]),[y,g]=_.useState(!1),[w,v]=_.useState(null),[S,T]=_.useState(!1),[L,D]=_.useState(!1),[$,I]=_.useState(null),J=_.useRef(null),ie=Wr({isOpen:n,onClose:r,dialogRef:J});_.useEffect(()=>{if(!n)return;async function ae(){if(a){g(!0);try{const A=await _x({filePath:a});d(A.image),m(A.content),U(A.content)}catch(A){v(A.message)}finally{g(!1)}}}ae()},[n,a]);const U=ae=>{const A=ae.split(";").map(W=>{const le=W.split("=");return{key:le[0]||"",value:le[1]||""}}).filter(W=>W.key||W.value);x(A)},R=async ae=>{const A=ae.filter(W=>W.key.trim()).map(W=>`${W.key.trim()}=${W.value.trim()}`).join(";");if(m(A),!A){d(null);return}try{const W=await _x({content:A});d(W.image)}catch(W){console.error("Failed to re-generate barcode:",W)}},Q=(ae,A,W)=>{const le=[...p];le[ae][A]=W,x(le),R(le)},fe=()=>{const ae=[...p,{key:"",value:""}];x(ae)},B=ae=>{const A=p.filter((W,le)=>le!==ae);x(A),R(A)},ne=()=>{if(!u||p.some(A=>A.key.toLowerCase()==="md5"))return;const ae=[...p,{key:"md5",value:u}];x(ae),R(ae)},V=async()=>{if(s){I("Saving…");try{const ae=await k2(s,`profiles-qr-${Date.now()}.png`);I(ae.path||ae.message)}catch(ae){I(`Save failed: ${(ae==null?void 0:ae.message)??ae}`)}finally{setTimeout(()=>I(null),6e3)}}},se=async()=>{try{await navigator.clipboard.writeText(f),T(!0),setTimeout(()=>T(!1),2e3)}catch(ae){console.error("Copy failed",ae)}},ve=async()=>{if(s)try{const A=await(await fetch(s)).blob();await navigator.clipboard.write([new ClipboardItem({[A.type]:A})]),D(!0),setTimeout(()=>D(!1),2e3)}catch(ae){console.error("Image copy failed",ae)}};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4",onClick:r,children:h.jsxs("div",{ref:J,role:"dialog","aria-modal":"true","aria-label":"QR Code Settings",onKeyDown:ie,className:"animate-modal-in w-full max-w-md rounded-xl border border-frame-line glass-panel p-6",onClick:ae=>ae.stopPropagation(),children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[h.jsx("h3",{className:"text-sm font-semibold text-ink",children:"QR Code Settings"}),h.jsx("button",{onClick:r,className:"focus-ring rounded-md p-1 text-ink-muted hover:bg-elevated hover:text-ink",children:h.jsx(nl,{className:"h-4 w-4"})})]}),y?h.jsx("div",{className:"flex h-48 items-center justify-center",children:h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-600 border-t-transparent"})}):w?h.jsx("div",{className:"rounded-md border border-status-danger-border bg-status-danger-bg p-4 text-center text-xs text-status-danger-text",children:w}):h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-col items-center gap-4",children:[h.jsxs("div",{className:"relative group",children:[h.jsx("div",{className:"h-48 w-48 overflow-hidden rounded-lg border border-line bg-white p-2",children:s?h.jsx("img",{src:s,alt:"QR Code",className:"h-full w-full object-contain"}):h.jsx("div",{className:"flex h-full items-center justify-center text-xs text-slate-400",children:"No content"})}),s&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-black/20 rounded-lg",children:h.jsxs("button",{onClick:ve,className:"focus-ring flex items-center gap-2 rounded-md bg-white/90 p-2 text-xs font-medium text-slate-900 shadow-sm hover:bg-white",children:[L?h.jsx(vi,{className:"h-3.5 w-3.5"}):h.jsx(yn,{className:"h-3.5 w-3.5"}),L?"Copied":"Copy Image"]})})]}),h.jsxs("div",{className:"flex w-full gap-2",children:[h.jsxs("button",{onClick:se,className:"btn btn-secondary flex-1 px-3 py-1.5",children:[S?h.jsx(vi,{className:"h-3.5 w-3.5 text-status-success-text"}):h.jsx(yn,{className:"h-3.5 w-3.5"}),"Copy Content"]}),h.jsxs("button",{onClick:V,disabled:!s,className:"btn btn-primary flex-1 px-3 py-1.5",children:[h.jsx(Ky,{className:"h-3.5 w-3.5"}),"Save Image"]})]}),$&&h.jsx("p",{className:"break-all text-center text-[11px] text-ink-muted",role:"status",children:$})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("label",{className:"text-xs font-medium text-ink-muted uppercase tracking-wider",children:"Payload Fields"}),h.jsxs("div",{className:"flex gap-2",children:[u&&!p.some(ae=>ae.key==="md5")&&h.jsxs("button",{onClick:ne,className:"btn-chip flex items-center gap-1 rounded px-2 py-0.5 text-[10px] font-bold text-chip-purple-text border border-chip-purple-border",children:[h.jsx(Zr,{className:"h-3 w-3"})," Inc. MD5"]}),h.jsxs("button",{onClick:fe,className:"btn-chip flex items-center gap-1 rounded px-2 py-0.5 text-[10px] font-bold text-chip-indigo-text border border-chip-indigo-border",children:[h.jsx(Bw,{className:"h-3 w-3"})," Add Field"]})]})]}),h.jsxs("div",{className:"max-h-48 space-y-2 overflow-y-auto pr-1 custom-scrollbar",children:[p.map((ae,A)=>h.jsxs("div",{className:"flex gap-2 items-center slide-in",children:[h.jsx("input",{type:"text",placeholder:"key",value:ae.key,onChange:W=>Q(A,"key",W.target.value),className:"w-1/3 rounded border border-line bg-elevated px-2 py-1 text-xs text-ink focus:border-indigo-500 focus:outline-none"}),h.jsx("input",{type:"text",placeholder:"value",value:ae.value,onChange:W=>Q(A,"value",W.target.value),className:"flex-1 rounded border border-line bg-elevated px-2 py-1 text-xs text-ink focus:border-indigo-500 focus:outline-none"}),h.jsx("button",{onClick:()=>B(A),className:"p-1 text-ink-muted hover:text-status-danger-text transition-colors","aria-label":"Remove field",children:h.jsx(Wy,{className:"h-3.5 w-3.5"})})]},A)),p.length===0&&h.jsx("p",{className:"text-center py-4 text-xs text-ink-muted italic",children:"No fields defined"})]})]}),h.jsxs("div",{className:"pt-2 border-t border-line",children:[h.jsx("label",{className:"text-[10px] font-medium text-ink-muted uppercase tracking-wider block mb-1.5",children:"Raw Preview"}),h.jsx("div",{className:"rounded bg-elevated p-2 font-mono text-[10px] text-ink-secondary break-all border border-line",children:f||h.jsx("span",{className:"italic text-ink-muted/50",children:"empty"})})]})]})]})}):null}const Gx=["Bytes","KB","MB","GB","TB"];function ib(n){if(n===0)return"0 Bytes";const r=1024,a=Math.max(0,Math.min(Gx.length-1,Math.floor(Math.log(n)/Math.log(r))));return parseFloat((n/Math.pow(r,a)).toFixed(2))+" "+Gx[a]}function Ok(n){const r=Math.max(n.lastIndexOf("\\"),n.lastIndexOf("/"));return r===-1?"":n.slice(0,r)}function Rk(n){const r=[`File Properties: ${n.name}`,`Path: ${n.path}`,`Type: ${n.type}`,`Size: ${ib(n.size_bytes)}`,`Created: ${n.created}`,`Modified: ${n.modified}`];return n.md5&&r.push(`MD5: ${n.md5}`),n.sha256&&r.push(`SHA256: ${n.sha256}`),r.join(` +`)}function td(n,r,a){return n.length<=r+a+1?n:`${n.slice(0,r)}…${n.slice(-a)}`}function Lk(n){const r=n.includes("\\")?"\\":"/",a=n.split(/[\\/]/);return a.length<=5?n:[a[0],a[1],"…",a[a.length-2],a[a.length-1]].join(r)}const Uk=[{ms:1e3*60,unit:"minute"},{ms:1e3*60*60,unit:"hour"},{ms:1e3*60*60*24,unit:"day"},{ms:1e3*60*60*24*30,unit:"month"},{ms:1e3*60*60*24*365,unit:"year"}];function Qx(n,r=new Date){const a=new Date(n.replace(" ","T"));if(Number.isNaN(a.getTime()))return"just now";const u=r.getTime()-a.getTime();if(u<6e4)return"just now";let s="just now";for(const{ms:d,unit:f}of Uk){if(u{var V;n||((V=I.current)==null||V.focus(),v(!1))},[n]),_.useEffect(()=>{if(!n||!r)return;const V=new AbortController;return J.current=V,d(null),D(null),m(!0),x(null),(async()=>{try{const se=await v2(r.path,V.signal);if(J.current!==V)return;d(se)}catch(se){if(J.current!==V||se instanceof DOMException&&se.name==="AbortError")return;x(se instanceof Error?se.message:"Failed to load properties")}finally{J.current===V&&m(!1)}})(),()=>{J.current=null,V.abort()}},[n,r]),_.useEffect(()=>{if(!n)return;const V=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=V}},[n]),_.useEffect(()=>{if(!n)return;const V=se=>{if(se.key==="Escape"){if(w)return;a();return}if(se.key!=="Tab")return;const ve=$.current;if(!ve)return;const ae=Array.from(ve.querySelectorAll('button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(re=>re.offsetParent!==null);if(ae.length===0)return;const A=ae[0],W=ae[ae.length-1],le=document.activeElement instanceof HTMLElement?document.activeElement:null;se.shiftKey?(le===A||!ve.contains(le))&&(se.preventDefault(),W.focus()):le===W&&(se.preventDefault(),A.focus())};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[n,w,a]),_.useEffect(()=>{if(!n)return;const V=document.activeElement instanceof HTMLElement?document.activeElement:null;I.current=V;const se=requestAnimationFrame(()=>{var ve,ae;(ae=(ve=$.current)==null?void 0:ve.querySelector("button"))==null||ae.focus()});return()=>cancelAnimationFrame(se)},[n]);const ie=async(V,se)=>{try{await navigator.clipboard.writeText(V),g(se),setTimeout(()=>g(null),2e3)}catch(ve){console.error("Failed to copy:",ve)}},U=async(V,se,ve)=>{T(V),D(null);try{await ve(),D(se)}catch{D("Action failed")}finally{T(null)}},R=V=>`btn btn-chip rounded-md border px-3 py-2 text-xs ${{reveal:"bg-chip-sky-bg text-chip-sky-text border-chip-sky-border",launch:"border-emerald-500/30 bg-emerald-600 font-semibold text-white hover:bg-emerald-500",folder:"bg-chip-amber-bg text-chip-amber-text border-chip-amber-border"}[V]??"bg-chip-indigo-bg text-chip-indigo-text border-chip-indigo-border"}`,Q=(V,se,ve,ae=!1,A)=>h.jsxs("div",{className:"flex items-start gap-2 py-1.5 group",children:[h.jsxs("span",{className:"text-ink-muted min-w-[100px] text-xs",children:[V,":"]}),h.jsx("div",{className:"flex-1 min-w-0",children:h.jsx("span",{className:`text-ink text-xs break-all ${ae?"font-mono":""}`,children:A??se})}),h.jsx(He,{text:"Copy to clipboard",block:!1,children:h.jsx("button",{onClick:()=>ie(se,ve),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-elevated","aria-label":`Copy ${V}`,children:y===ve?h.jsx(vi,{className:"h-3.5 w-3.5 text-status-success-text"}):h.jsx(yn,{className:"h-3.5 w-3.5 text-ink-muted"})})})]}),fe=(V,se,ve)=>h.jsxs("div",{className:"rounded-lg border border-line bg-elevated p-4",children:[h.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[se,h.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-ink-muted",children:V})]}),ve]}),B=()=>h.jsx(He,{text:"Click to copy full path",children:h.jsxs("button",{onClick:()=>void ie(s.path,"path"),className:"group mb-3 flex w-full items-center gap-2 rounded-lg border border-line bg-elevated px-3 py-2 text-left hover:bg-surface",children:[h.jsx(ss,{className:"text-chip-amber-text h-4 w-4 flex-shrink-0"}),h.jsx("span",{className:"text-ink min-w-0 flex-1 truncate font-mono text-xs",children:Lk(s.path)}),y==="path"?h.jsx(vi,{className:"text-status-success-text h-3.5 w-3.5"}):h.jsx(yn,{className:"text-ink-muted h-3.5 w-3.5"})]})});if(!n||!r)return null;const ne=r;return h.jsxs("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 backdrop-blur-md p-4",role:"dialog","aria-modal":"true","aria-labelledby":"properties-modal-title",children:[h.jsx("div",{className:"absolute inset-0",onClick:a,onContextMenu:V=>{V.preventDefault(),a()}}),h.jsxs("div",{ref:$,className:"animate-modal-in relative w-full max-w-4xl max-h-[90vh] overflow-hidden rounded-xl border border-frame-line glass-panel flex flex-col",children:[h.jsx("div",{className:"flex-shrink-0 border-b border-line px-6 py-4",children:h.jsxs("div",{className:"flex items-start justify-between gap-4",children:[h.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[h.jsx("div",{className:"rounded-lg bg-indigo-600 p-2 flex-shrink-0",children:h.jsx(Wf,{className:"h-5 w-5 text-white"})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("h3",{id:"properties-modal-title",className:"text-base font-semibold text-ink truncate",children:"File Properties"}),h.jsx("p",{className:"text-xs text-ink-muted truncate",children:r.filename})]}),h.jsx(He,{text:"Copy all properties to clipboard",block:!1,children:h.jsx("button",{onClick:()=>{s&&ie(Rk(s),"all")},disabled:!s||f||p!==null,className:"btn-chip ml-2 flex items-center gap-1 rounded-md border border-chip-indigo-border bg-chip-indigo-bg p-1.5 text-chip-indigo-text","aria-label":"Copy all properties",children:y==="all"?h.jsx(vi,{className:"h-4 w-4 text-status-success-text"}):h.jsx(yn,{className:"h-4 w-4"})})}),h.jsx(He,{text:"Generate Barcode/QR Code",block:!1,children:h.jsx("button",{onClick:()=>v(!0),className:"btn-chip rounded-md border border-chip-indigo-border bg-chip-indigo-bg p-1.5 text-chip-indigo-text",children:h.jsx(Gd,{className:"h-4 w-4"})})})]}),h.jsx("button",{onClick:a,className:"focus-ring rounded-md p-1 text-ink-muted hover:bg-elevated hover:text-ink flex-shrink-0","aria-label":"Close",children:h.jsx(nl,{className:"h-4 w-4"})})]})}),h.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:[f&&h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsxs("div",{className:"flex flex-col items-center gap-2",children:[h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-600 border-t-transparent"}),h.jsx("p",{className:"text-xs text-ink-muted",children:"Loading properties..."})]})}),p&&h.jsx("div",{className:"rounded-lg border border-status-danger-border bg-status-danger-bg p-4 text-center",children:h.jsx("p",{className:"text-xs text-status-danger-text",children:p})}),s&&!f&&!p&&h.jsxs("div",{children:[h.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-x-4 gap-y-1.5 rounded-lg border border-line bg-elevated px-4 py-2.5",children:[h.jsx("span",{className:"inline-flex items-center gap-1 rounded-md border border-chip-indigo-border bg-chip-indigo-bg px-2 py-0.5 text-xs font-semibold text-chip-indigo-text",children:s.type}),s.attributes.extension&&h.jsx("span",{className:"inline-flex items-center rounded-md border border-line bg-surface px-2 py-0.5 text-xs font-medium text-ink-muted",children:s.attributes.extension}),h.jsxs("span",{className:"text-xs text-ink-muted",title:`${s.size_bytes} bytes`,children:["Size ",h.jsx("strong",{className:"text-ink font-medium",children:ib(s.size_bytes)})]}),h.jsxs("span",{className:"text-xs text-ink-muted",title:s.created,children:["Created ",h.jsx("strong",{className:"text-ink font-medium",children:Qx(s.created)})]}),h.jsxs("span",{className:"text-xs text-ink-muted",title:s.modified,children:["Modified ",h.jsx("strong",{className:"text-ink font-medium",children:Qx(s.modified)})]}),s.md5&&h.jsx("span",{className:"inline-flex items-center rounded-md border border-chip-purple-border bg-chip-purple-bg px-2 py-0.5 font-mono text-xs font-medium text-chip-purple-text",title:`MD5 ${s.md5}`,children:td(s.md5,4,4)}),s.attributes.is_symlink&&h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-chip-fuchsia-border bg-chip-fuchsia-bg px-2 py-0.5 text-xs font-medium text-chip-fuchsia-text",children:[h.jsx(Tw,{className:"h-3 w-3"})," Symlink"]})]}),B(),h.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[fe("Hashes",h.jsx(Zr,{className:"text-chip-purple-text h-3.5 w-3.5"}),h.jsxs("div",{className:"space-y-0.5",children:[Q("MD5",s.md5,"md5",!0,td(s.md5,10,6)),Q("SHA256",s.sha256,"sha256",!0,td(s.sha256,10,6))]})),fe("Timestamps",h.jsx(Q2,{className:"text-chip-sky-text h-3.5 w-3.5"}),h.jsxs("div",{className:"space-y-0.5",children:[Q("Created",s.created,"created",!0),Q("Modified",s.modified,"modified",!0)]})),fe("Identity",h.jsx(Wf,{className:"text-chip-indigo-text h-3.5 w-3.5"}),h.jsxs("div",{className:"space-y-0.5",children:[Q("Type",s.type,"type"),s.attributes.stem&&Q("Stem",s.attributes.stem,"attrStem"),Q("Extension",s.name.includes(".")?s.name.slice(s.name.lastIndexOf(".")):"None","extension"),Q("Directory",Ok(s.path)||"None","directory",!0)]})),fe("System",h.jsx(Wf,{className:"text-status-success-text h-3.5 w-3.5"}),h.jsxs("div",{children:[h.jsxs("div",{className:"mb-1 flex min-h-[24px] flex-wrap items-center gap-1.5",children:[s.attributes.is_readonly&&h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-status-danger-border bg-status-danger-bg px-2 py-0.5 text-xs text-status-danger-text",children:[h.jsx(zw,{className:"h-3 w-3"})," Read-only"]}),s.attributes.is_hidden&&h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-slate-500/30 bg-slate-600/20 px-2 py-0.5 text-xs text-slate-300",children:[h.jsx(fw,{className:"h-3 w-3"})," Hidden"]}),!s.attributes.is_readonly&&!s.attributes.is_hidden&&!s.attributes.is_symlink&&h.jsx("span",{className:"text-xs text-ink-muted",children:"No special flags"})]}),h.jsxs("div",{className:"space-y-0.5",children:[Q("File Type",s.attributes.is_file?"Regular File":s.attributes.is_dir?"Directory":"Other","fileType"),s.attributes.permissions&&Q("Permissions",s.attributes.permissions,"permissions",!0),s.attributes.owner_uid!==void 0&&Q("Owner UID",String(s.attributes.owner_uid),"ownerUid"),s.attributes.group_gid!==void 0&&Q("Group GID",String(s.attributes.group_gid),"groupGid")]})]}))]})]})]}),h.jsx("div",{className:"flex-shrink-0 border-t border-line px-6 py-3",children:h.jsxs("div",{className:"flex justify-between items-center gap-2",children:[h.jsx("p",{className:"min-w-0 text-xs text-ink-muted truncate",children:L??"Click the copy icon next to any field to copy its value"}),h.jsxs("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[h.jsx(He,{text:"Show file in Explorer",block:!1,children:h.jsxs("button",{onClick:()=>void U("reveal","Revealed in Explorer",()=>Gy(ne.path)),disabled:S!==null,className:R("reveal"),children:[h.jsx(vd,{className:"h-3.5 w-3.5"})," Reveal"]})}),h.jsx(He,{text:"Launch file with default association",block:!1,children:h.jsxs("button",{onClick:()=>{u&&(T("launch"),Promise.resolve(u(ne)).finally(()=>T(null)))},disabled:S!==null||!u,className:R("launch"),children:[h.jsx(er,{className:"h-3.5 w-3.5"})," Launch"]})}),h.jsx(He,{text:"Open containing folder",block:!1,children:h.jsxs("button",{onClick:()=>void U("folder","Opened folder",()=>yd(ne.path)),disabled:S!==null,className:R("folder"),children:[h.jsx(Ji,{className:"h-3.5 w-3.5"})," Open Folder"]})}),h.jsx("button",{onClick:a,className:"btn btn-primary px-4 py-2",children:"Close"})]})]})})]}),h.jsx(lb,{isOpen:w,onClose:()=>v(!1),initialFilePath:r.path,md5:s==null?void 0:s.md5})]})}const Hk=["qr_code","code_128","code_39","ean_13","ean_8","upc_a","upc_e","data_matrix"],qk=250,Fk=400,Vk=.7;function Yk(n,r=Fk,a=Vk){const u=n.videoWidth,s=n.videoHeight;if(!u||!s)return null;const d=Math.min(u,s),f=document.createElement("canvas");f.width=Math.min(r,d),f.height=f.width;const m=f.getContext("2d");if(!m)return null;m.drawImage(n,(u-d)/2,(s-d)/2,d,d,0,0,f.width,f.height);const p=f.toDataURL("image/jpeg",a);return p.slice(p.indexOf(",")+1)}function Gk(n,r){const a=n.intervalMs??qk;let u=!1,s=!1;const d=()=>{u=!0,clearInterval(f)},f=setInterval(()=>{if(u||s)return;const m=n.capture();m&&(s=!0,n.decode(m).then(p=>{u||p.decoded&&(d(),r.onDetected(p.decoded))}).catch(p=>{u||(d(),r.onError(p instanceof Error?p.message:"Frame decoding failed"))}).finally(()=>{s=!1}))},a);return d}const Qk=8e3;function Xk({isOpen:n,onClose:r,onDetected:a}){const u=_.useRef(null),s=_.useRef(null),d=Wr({isOpen:n,onClose:r,dialogRef:s}),f=_.useRef(null),m=_.useRef(null),p=_.useRef(null),[x,y]=_.useState(null),[g,w]=_.useState(!1),v=()=>{p.current&&(p.current(),p.current=null),m.current&&(cancelAnimationFrame(m.current),m.current=null),f.current&&(f.current.getTracks().forEach(L=>L.stop()),f.current=null),u.current&&(u.current.srcObject=null)};_.useEffect(()=>{if(!n){v(),y(null);return}let L=!0;async function D(){var I,J,ie,U,R;if(y(null),w(!1),typeof window<"u"&&!window.isSecureContext&&window.location.hostname!=="localhost"&&window.location.hostname!=="127.0.0.1"){y("Camera access requires HTTPS or localhost. If connecting across a local network IP (e.g. 192.168.x.x), modern browsers disable camera access for insecure HTTP.");return}const $=((J=(I=navigator.mediaDevices)==null?void 0:I.getUserMedia)==null?void 0:J.bind(navigator.mediaDevices))||((ie=navigator.getUserMedia)==null?void 0:ie.bind(navigator))||((U=navigator.webkitGetUserMedia)==null?void 0:U.bind(navigator))||((R=navigator.mozGetUserMedia)==null?void 0:R.bind(navigator));if(!$){y(window.isSecureContext?"Camera access is not supported by your browser or environment.":"Camera access is blocked because the page is not served over a secure origin (HTTPS or localhost/127.0.0.1).");return}try{let Q;const fe=await Promise.race([$({video:{facingMode:"environment",width:{ideal:1280},height:{ideal:720}}}),new Promise((B,ne)=>{Q=window.setTimeout(()=>ne(new DOMException("Camera did not start in time","TimeoutError")),Qk)})]).finally(()=>{Q!==void 0&&window.clearTimeout(Q)});if(!L){fe.getTracks().forEach(B=>B.stop());return}f.current=fe,u.current&&(u.current.srcObject=fe,await u.current.play()),"BarcodeDetector"in window?T():S()}catch(Q){if(!L)return;console.error("Camera access error:",Q),y(Q.name==="NotAllowedError"||Q.name==="PermissionDeniedError"?"Camera permission denied. Please allow camera access in your browser settings.":Q.name==="TimeoutError"?"The camera did not start in time. On macOS, camera capture needs the packaged desktop app — a bare Python process cannot access the camera. Alternatively, open ProFiles in Chrome, Edge or Safari.":`Could not access camera: ${Q.message||"Unknown error"}`)}}return D(),()=>{L=!1,v()}},[n]);const S=()=>{w(!0),p.current=Gk({capture:()=>u.current?Yk(u.current):null,decode:L=>b2({imageBase64:L,formats:[...Hk]})},{onDetected:L=>{v(),a(L)},onError:L=>{v(),y(L)}})},T=()=>{const L=["qr_code","code_128","code_39","ean_13","ean_8","upc_a","upc_e","data_matrix"];let D;try{D=new window.BarcodeDetector({formats:L})}catch(I){console.warn("BarcodeDetector formats unsupported:",I),D=new window.BarcodeDetector}const $=async()=>{if(!u.current||u.current.readyState<2){m.current=requestAnimationFrame($);return}try{const I=await D.detect(u.current);if(I&&I.length>0){const J=I[0].rawValue;if(J){v(),a(J);return}}}catch(I){console.debug("Frame detection error:",I)}m.current=requestAnimationFrame($)};m.current=requestAnimationFrame($)};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/70 p-4 backdrop-blur-sm",onClick:r,children:h.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-label":"Camera barcode scanner",onKeyDown:d,className:"relative w-full max-w-lg rounded-2xl border border-frame-line glass-panel p-6 flex flex-col",onClick:L=>L.stopPropagation(),children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink",children:[h.jsx(Iy,{className:"h-5 w-5 text-chip-indigo-text"}),h.jsx("span",{children:"Scan with Camera"})]}),h.jsx("button",{onClick:r,className:"focus-ring rounded-lg p-1 text-ink-muted hover:bg-elevated hover:text-ink transition-colors","aria-label":"Close",children:h.jsx(nl,{className:"h-4 w-4"})})]}),x?h.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[h.jsx("div",{className:"rounded-full bg-status-danger-bg p-3 text-status-danger-text mb-3",children:h.jsx(lu,{className:"h-6 w-6"})}),h.jsx("p",{className:"text-xs text-status-danger-text max-w-xs",children:x}),h.jsx("button",{onClick:r,className:"btn btn-secondary mt-6 px-4 py-2",children:"Close"})]}):h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsxs("div",{className:"relative aspect-video w-full overflow-hidden rounded-xl bg-black border border-line flex items-center justify-center",children:[h.jsx("video",{ref:u,playsInline:!0,muted:!0,className:"h-full w-full object-cover"}),h.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:h.jsxs("div",{className:"relative h-48 w-48 rounded-lg border-2 border-dashed border-indigo-400/80 bg-indigo-500/5 shadow-[0_0_0_9999px_rgba(0,0,0,0.45)]",children:[h.jsx("div",{className:"absolute top-0 left-0 h-4 w-4 border-t-2 border-l-2 border-indigo-400"}),h.jsx("div",{className:"absolute top-0 right-0 h-4 w-4 border-t-2 border-r-2 border-indigo-400"}),h.jsx("div",{className:"absolute bottom-0 left-0 h-4 w-4 border-b-2 border-l-2 border-indigo-400"}),h.jsx("div",{className:"absolute bottom-0 right-0 h-4 w-4 border-b-2 border-r-2 border-indigo-400"})]})})]}),h.jsx("p",{className:"mt-4 text-center text-xs text-ink-muted",children:g?"Hold a QR code or barcode steady in front of your camera — frames are decoded by the local ProFiles server (no native Barcode Detector in this browser).":"Hold a QR code or barcode steady in front of your camera to auto-scan."})]})]})}):null}function Ik({isOpen:n,file:r,onConfirm:a,onDismiss:u}){const s=_.useRef(null);return _.useEffect(()=>{var d;if(n){const f=m=>{m.key==="Enter"?(m.preventDefault(),a()):m.key==="Escape"&&(m.preventDefault(),u())};return window.addEventListener("keydown",f),(d=s.current)==null||d.focus(),()=>window.removeEventListener("keydown",f)}},[n,a,u]),!n||!r?null:h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",onClick:u,children:h.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":`1 file matched: ${r.filename}`,className:"animate-modal-in w-full max-w-sm rounded-xl border border-frame-line glass-panel p-5 flex flex-col gap-4",onClick:d=>d.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink text-sm",children:[r.has_hook?h.jsx(nk,{className:"h-4 w-4 text-chip-purple-text"}):h.jsx(er,{className:"h-4 w-4 text-status-success-text"}),h.jsx("span",{children:"1 File Matched"})]}),h.jsx("button",{onClick:u,className:"focus-ring rounded p-1 text-ink-muted hover:bg-elevated hover:text-ink","aria-label":"Dismiss",children:h.jsx(nl,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-line bg-elevated/50 p-3",children:[h.jsx(Pr,{className:"h-5 w-5 text-chip-indigo-text shrink-0 mt-0.5"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("h4",{className:"text-xs font-semibold text-ink truncate",children:r.filename}),h.jsx("p",{className:"text-[11px] text-ink-muted truncate mt-0.5",children:r.rel_path||r.path}),r.has_hook&&h.jsx("span",{className:"inline-block mt-1 text-[10px] text-chip-purple-text bg-chip-purple-bg px-1.5 py-0.5 rounded border border-chip-purple-border/50 font-medium",children:"Workflow Hook Configured"})]})]}),h.jsx("p",{className:"text-xs text-ink-muted text-center",children:"Launch this file now?"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{type:"button",onClick:u,className:"btn btn-secondary flex-1 px-3 py-1.5",children:"Dismiss (Esc)"}),h.jsxs("button",{ref:s,type:"button",onClick:a,className:"btn btn-primary flex-1 px-3 py-1.5 shadow-md",children:[h.jsx(er,{className:"h-3 w-3 fill-current"}),"Launch (Enter)"]})]})]})})}function Kk({systemInfo:n,fileCount:r,theme:a,onToggleTheme:u,onOpenLog:s,onOpenConfig:d,onLoadConfig:f,onShowShortcuts:m,onReloadConfig:p,onExport:x,exportDisabled:y=!1,language:g="en",onLanguageChange:w,activeConfigName:v,lanEnabled:S,onToggleLan:T}){return h.jsxs("footer",{className:"flex items-center justify-between border-t border-line bg-app px-4 py-2 text-[11px] text-ink-muted transition-colors duration-200",children:[h.jsx("div",{className:"flex items-center gap-4",children:n&&h.jsxs("div",{className:"flex items-center gap-1.5 rounded-full border border-line bg-surface px-2.5 py-0.5 text-ink-secondary",children:[h.jsx(M2,{className:"h-3 w-3 text-status-success-text"}),h.jsx("a",{href:`http://${n.hostname}:${window.location.port}`,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ProFiles on ${n.hostname}`,className:"font-mono hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 rounded px-1 py-0.5",children:n.hostname}),h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsx("a",{href:`http://${n.ip}:${window.location.port}`,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ProFiles on ${n.ip}`,className:"font-mono hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 rounded px-1 py-0.5",children:n.ip}),h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsxs("span",{className:"flex items-center gap-1",title:"Session user",children:[h.jsx(Ww,{className:"h-3 w-3 text-ink-faint"}),h.jsx("span",{children:n.username||"operator"})]}),T!==void 0&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsx(He,{text:"LAN access",block:!1,children:h.jsxs("button",{onClick:()=>T(S!==!0),disabled:S===null,"aria-pressed":S===!0,className:`focus-ring flex items-center gap-1 rounded px-1 py-0.5 text-[10px] ${S===null?"text-ink-faint cursor-not-allowed":S===!0?"text-status-success-text":"text-ink-muted hover:text-ink"}`,children:[h.jsx(Rw,{className:"h-3 w-3"}),h.jsx("span",{children:"LAN"})]})})]})]})}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("span",{children:[h.jsx("strong",{className:"text-ink",children:r})," files found"]}),h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsx(He,{text:"Keyboard shortcuts (?)",block:!1,children:h.jsxs("button",{onClick:m,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx($y,{className:"h-3 w-3"}),h.jsx("span",{children:"Shortcuts"})]})}),h.jsx(He,{text:"Open the application log viewer",block:!1,children:h.jsxs("button",{onClick:s,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Pr,{className:"h-3 w-3"}),h.jsx("span",{children:"Logs"})]})}),h.jsx("span",{className:"text-ink-faint",children:"|"}),p&&h.jsx(He,{text:"Reload configuration from disk",block:!1,children:h.jsxs("button",{onClick:p,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(cs,{className:"h-3 w-3"}),h.jsx("span",{children:"Reload"})]})}),x&&h.jsx(He,{text:"Export the current results as CSV",block:!1,children:h.jsxs("button",{onClick:x,disabled:y,className:"focus-ring flex items-center gap-1 rounded text-ink-muted hover:text-ink disabled:opacity-40 disabled:hover:text-ink-muted",children:[h.jsx(Ky,{className:"h-3 w-3"}),h.jsx("span",{children:"Export CSV"})]})}),w&&h.jsxs("div",{className:"flex items-center overflow-hidden rounded border border-line text-[10px]",children:[h.jsx(He,{text:"English",block:!1,children:h.jsxs("button",{onClick:()=>w("en"),className:`flex items-center gap-1 px-1.5 py-0.5 transition-colors ${g==="en"?"bg-indigo-600 text-white focus-ring":"text-ink-muted hover:text-ink focus-ring"}`,children:[h.jsx(kw,{className:"h-3 w-3"}),h.jsx("span",{children:"EN"})]})}),h.jsx(He,{text:"Français",block:!1,children:h.jsx("button",{onClick:()=>w("fr"),className:`flex items-center gap-1 px-1.5 py-0.5 transition-colors ${g==="fr"?"bg-indigo-600 text-white focus-ring":"text-ink-muted hover:text-ink focus-ring"}`,children:h.jsx("span",{children:"FR"})})})]}),f&&h.jsx(He,{text:v?`Load a different .profiles file (active: ${v})`:"Load a .profiles file",block:!1,children:h.jsxs("button",{onClick:f,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Kr,{className:"h-3 w-3"}),h.jsx("span",{children:"Load config…"})]})}),h.jsx(He,{text:"Open configuration file",block:!1,children:h.jsxs("button",{onClick:d,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Qw,{className:"h-3 w-3"}),h.jsx("span",{children:"Config"})]})}),h.jsx(He,{text:`Switch to ${a==="dark"?"light":"dark"} mode`,block:!1,children:h.jsxs("button",{onClick:u,className:"focus-ring flex items-center gap-1 rounded px-1.5 py-0.5 text-ink-muted hover:bg-elevated hover:text-status-warning-text",children:[a==="dark"?h.jsx(Iw,{className:"h-3 w-3 text-status-warning-text"}):h.jsx(Mw,{className:"h-3 w-3 text-chip-indigo-text"}),h.jsx("span",{children:a==="dark"?"Light":"Dark"})]})})]})]})}const Zk=[{label:"5 seconds",seconds:5},{label:"10 seconds",seconds:10},{label:"30 seconds",seconds:30},{label:"1 minute",seconds:60},{label:"5 minutes",seconds:300}];function $k({isOpen:n,currentInterval:r,onClose:a,onSetInterval:u}){const s=_.useRef(null),d=Wr({isOpen:n,onClose:a,dialogRef:s});if(!n)return null;const f=r>0,m=y=>{u(y)},p=y=>{y.preventDefault();const w=y.currentTarget.elements.namedItem("custom-interval"),v=parseInt(w.value,10);!isNaN(v)&&v>0&&u(v)},x=()=>{u(0)};return h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",children:h.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-label":"Auto-Rescan Timer",onKeyDown:d,className:"animate-modal-in w-[420px] max-w-full rounded-2xl border border-frame-line glass-panel p-5",children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink",children:[h.jsx(Py,{className:"h-5 w-5 text-chip-indigo-text"}),h.jsx("span",{children:"Auto-Rescan Timer"})]}),h.jsx("button",{onClick:a,className:"focus-ring rounded-lg p-1 text-ink-muted hover:bg-elevated hover:text-ink",children:h.jsx(nl,{className:"h-4 w-4"})})]}),h.jsx("div",{className:"mb-4 rounded-lg bg-elevated/50 px-3 py-2 text-xs",children:f?h.jsxs("div",{className:"flex items-center gap-2 text-status-success-text",children:[h.jsx(nw,{className:"h-4 w-4 animate-pulse"}),h.jsxs("span",{children:["Auto-rescan every ",r,"s"]})]}):h.jsxs("div",{className:"flex items-center gap-2 text-ink-secondary",children:[h.jsx(ew,{className:"h-4 w-4"}),h.jsx("span",{children:"Auto-rescan is disabled"})]})}),h.jsxs("div",{className:"mb-4 space-y-1 text-xs",children:[h.jsx("p",{className:"text-ink-muted",children:"Presets:"}),h.jsx("div",{className:"grid grid-cols-2 gap-2",children:Zk.map(y=>h.jsx("button",{onClick:()=>m(y.seconds),className:"rounded-lg border border-line bg-elevated/50 px-3 py-1.5 text-left font-medium text-ink-secondary hover:border-chip-indigo-border hover:bg-chip-indigo-bg/40 hover:text-chip-indigo-text focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:y.label},y.seconds))})]}),h.jsxs("form",{onSubmit:p,className:"mb-4",children:[h.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-ink-secondary",children:[h.jsx(rw,{className:"h-3.5 w-3.5"}),h.jsx("span",{children:"Custom interval (seconds):"})]}),h.jsxs("div",{className:"mt-1 flex gap-2",children:[h.jsx("input",{type:"number",name:"custom-interval",min:"1",placeholder:"e.g. 45",className:"flex-1 rounded-lg border border-line bg-app px-2 py-1 text-xs text-ink placeholder-ink-faint focus:border-indigo-500 focus:outline-none"}),h.jsx("button",{type:"submit",className:"btn btn-primary rounded-lg px-3 py-1 font-semibold",children:"Set"})]})]}),f&&h.jsx("button",{onClick:x,className:"btn w-full rounded-lg border-line bg-elevated/50 px-3 py-2 text-status-warning-text hover:border-status-warning-border hover:bg-status-warning-bg/40",children:"Stop Auto-Rescan"}),h.jsx("div",{className:"flex justify-end gap-2 border-t border-line pt-3",children:h.jsx("button",{onClick:a,className:"rounded-lg border border-line bg-elevated px-4 py-2 text-xs font-semibold text-ink-secondary hover:bg-elevated/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:"Close"})})]})})}function Jk(n,r){const a={};return(n[n.length-1]===""?[...n,""]:n).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const Pk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Wk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,eS={};function Xx(n,r){return(eS.jsx?Wk:Pk).test(n)}const tS=/[ \t\n\f\r]/g;function nS(n){return typeof n=="object"?n.type==="text"?Ix(n.value):!1:Ix(n)}function Ix(n){return n.replace(tS,"")===""}class ou{constructor(r,a,u){this.normal=a,this.property=r,u&&(this.space=u)}}ou.prototype.normal={};ou.prototype.property={};ou.prototype.space=void 0;function rb(n,r){const a={},u={};for(const s of n)Object.assign(a,s.property),Object.assign(u,s.normal);return new ou(a,u,r)}function Nd(n){return n.toLowerCase()}class bn{constructor(r,a){this.attribute=a,this.property=r}}bn.prototype.attribute="";bn.prototype.booleanish=!1;bn.prototype.boolean=!1;bn.prototype.commaOrSpaceSeparated=!1;bn.prototype.commaSeparated=!1;bn.prototype.defined=!1;bn.prototype.mustUseProperty=!1;bn.prototype.number=!1;bn.prototype.overloadedBoolean=!1;bn.prototype.property="";bn.prototype.spaceSeparated=!1;bn.prototype.space=void 0;let lS=0;const De=nr(),Ot=nr(),Ed=nr(),ce=nr(),ht=nr(),Pi=nr(),An=nr();function nr(){return 2**++lS}const jd=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:Ot,commaOrSpaceSeparated:An,commaSeparated:Pi,number:ce,overloadedBoolean:Ed,spaceSeparated:ht},Symbol.toStringTag,{value:"Module"})),nd=Object.keys(jd);class Qd extends bn{constructor(r,a,u,s){let d=-1;if(super(r,a),Kx(this,"space",s),typeof u=="number")for(;++d4&&a.slice(0,4)==="data"&&oS.test(r)){if(r.charAt(4)==="-"){const d=r.slice(5).replace(Zx,fS);u="data"+d.charAt(0).toUpperCase()+d.slice(1)}else{const d=r.slice(4);if(!Zx.test(d)){let f=d.replace(uS,cS);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}s=Qd}return new s(u,r)}function cS(n){return"-"+n.toLowerCase()}function fS(n){return n.charAt(1).toUpperCase()}const dS=rb([ab,iS,sb,cb,fb],"html"),Xd=rb([ab,rS,sb,cb,fb],"svg");function hS(n){return n.join(" ").trim()}var $x=/\/\*(?:[^*]|\*(?!\/))*\*\//g,mS=/\n/g,pS=/^\s*/,gS=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,xS=/^:\s*/,yS=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,bS=/^[;\s]*/,vS=` +`,Jx="/",Px="*",Pa="",wS="comment",kS="declaration";function SS(n,r){if(typeof n!="string")throw new TypeError("First argument must be a string");if(!n)return[];r=r||{};var a=1,u=1;function s(S){var T=S.match(mS);T&&(a+=T.length);var L=S.lastIndexOf(vS);u=~L?S.length-L:u+S.length}function d(){var S={line:a,column:u};return function(T){return T.position=new f(S),x(),T}}function f(S){this.start=S,this.end={line:a,column:u},this.source=r.source}f.prototype.content=n;function m(S){var T=new Error(r.source+":"+a+":"+u+": "+S);if(T.reason=S,T.filename=r.source,T.line=a,T.column=u,T.source=n,!r.silent)throw T}function p(S){var T=S.exec(n);if(T){var L=T[0];return s(L),n=n.slice(L.length),T}}function x(){p(pS)}function y(S){for(var T;T=g();)S.push(T);return S}function g(){var S=d();if(!(Jx!=n.charAt(0)||Px!=n.charAt(1))){for(var T=2;Pa!=n.charAt(T)&&(Px!=n.charAt(T)||Jx!=n.charAt(T+1));)++T;if(T+=2,Pa===n.charAt(T-1))return m("End of comment missing");var L=n.slice(2,T-2);return u+=2,s(L),n=n.slice(T),u+=2,S({type:wS,comment:L})}}function w(){var S=d(),T=p(gS);if(T){if(g(),!p(xS))return m("property missing ':'");var L=p(yS),D=S({type:kS,property:T[0].replace($x,Pa).trim(),value:L?L[0].replace($x,Pa).trim():Pa});return p(bS),D}}function v(){var S=[];y(S);for(var T;T=w();)S.push(T),y(S);return S}return x(),v()}function NS(n,r){let a=null;if(!n||typeof n!="string")return a;const u=SS(n),s=typeof r=="function";return u.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:m}=d;s?r(f,m,d):m&&(a=a??{},a[f]=m)}),a}const db=hb("end"),Id=hb("start");function hb(n){return r;function r(a){const u=a&&a.position&&a.position[n]||{};if(typeof u.line=="number"&&u.line>0&&typeof u.column=="number"&&u.column>0)return{line:u.line,column:u.column,offset:typeof u.offset=="number"&&u.offset>-1?u.offset:void 0}}}function ES(n){const r=Id(n),a=db(n);if(r&&a)return{start:r,end:a}}function iu(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?Wx(n.position):"start"in n||"end"in n?Wx(n):"line"in n||"column"in n?Cd(n):""}function Cd(n){return ey(n&&n.line)+":"+ey(n&&n.column)}function Wx(n){return Cd(n&&n.start)+"-"+Cd(n&&n.end)}function ey(n){return n&&typeof n=="number"?n:1}class an extends Error{constructor(r,a,u){super(),typeof a=="string"&&(u=a,a=void 0);let s="",d={},f=!1;if(a&&("line"in a&&"column"in a?d={place:a}:"start"in a&&"end"in a?d={place:a}:"type"in a?d={ancestors:[a],place:a.position}:d={...a}),typeof r=="string"?s=r:!d.cause&&r&&(f=!0,s=r.message,d.cause=r),!d.ruleId&&!d.source&&typeof u=="string"){const p=u.indexOf(":");p===-1?d.ruleId=u:(d.source=u.slice(0,p),d.ruleId=u.slice(p+1))}if(!d.place&&d.ancestors&&d.ancestors){const p=d.ancestors[d.ancestors.length-1];p&&(d.place=p.position)}const m=d.place&&"start"in d.place?d.place.start:d.place;this.ancestors=d.ancestors||void 0,this.cause=d.cause||void 0,this.column=m?m.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=m?m.line:void 0,this.name=iu(d.place)||"1:1",this.place=d.place||void 0,this.reason=this.message,this.ruleId=d.ruleId||void 0,this.source=d.source||void 0,this.stack=f&&d.cause&&typeof d.cause.stack=="string"?d.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}an.prototype.file="";an.prototype.name="";an.prototype.reason="";an.prototype.message="";an.prototype.stack="";an.prototype.column=void 0;an.prototype.line=void 0;an.prototype.ancestors=void 0;an.prototype.cause=void 0;an.prototype.fatal=void 0;an.prototype.place=void 0;an.prototype.ruleId=void 0;an.prototype.source=void 0;const Kd={}.hasOwnProperty,jS=new Map,CS=/[A-Z]/g,TS=/-([a-z])/g,_S=new Set(["table","tbody","thead","tfoot","tr"]),AS=new Set(["td","th"]),mb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function zS(n,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=r.filePath||void 0;let u;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");u=HS(a,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");u=BS(a,r.jsx,r.jsxs)}const s={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:u,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?Xd:dS,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},d=pb(s,n,void 0);return d&&typeof d!="string"?d:s.create(n,s.Fragment,{children:d||void 0},void 0)}function pb(n,r,a){if(r.type==="element")return DS(n,r,a);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return MS(n,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return RS(n,r,a);if(r.type==="mdxjsEsm")return OS(n,r);if(r.type==="root")return LS(n,r,a);if(r.type==="text")return US(n,r)}function DS(n,r,a){const u=n.schema;let s=u;r.tagName.toLowerCase()==="svg"&&u.space==="html"&&(s=Xd,n.schema=s),n.ancestors.push(r);const d=xb(n,r.tagName,!1),f=qS(n,r);let m=$d(n,r);return _S.has(r.tagName)&&(m=m.filter(function(p){return typeof p=="string"?!nS(p):!0})),gb(n,f,d,r),Zd(f,m),n.ancestors.pop(),n.schema=u,n.create(r,d,f,a)}function MS(n,r){if(r.data&&r.data.estree&&n.evaluater){const u=r.data.estree.body[0];return u.type,n.evaluater.evaluateExpression(u.expression)}uu(n,r.position)}function OS(n,r){if(r.data&&r.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(r.data.estree);uu(n,r.position)}function RS(n,r,a){const u=n.schema;let s=u;r.name==="svg"&&u.space==="html"&&(s=Xd,n.schema=s),n.ancestors.push(r);const d=r.name===null?n.Fragment:xb(n,r.name,!0),f=FS(n,r),m=$d(n,r);return gb(n,f,d,r),Zd(f,m),n.ancestors.pop(),n.schema=u,n.create(r,d,f,a)}function LS(n,r,a){const u={};return Zd(u,$d(n,r)),n.create(r,n.Fragment,u,a)}function US(n,r){return r.value}function gb(n,r,a,u){typeof a!="string"&&a!==n.Fragment&&n.passNode&&(r.node=u)}function Zd(n,r){if(r.length>0){const a=r.length>1?r:r[0];a&&(n.children=a)}}function BS(n,r,a){return u;function u(s,d,f,m){const x=Array.isArray(f.children)?a:r;return m?x(d,f,m):x(d,f)}}function HS(n,r){return a;function a(u,s,d,f){const m=Array.isArray(d.children),p=Id(u);return r(s,d,f,m,{columnNumber:p?p.column-1:void 0,fileName:n,lineNumber:p?p.line:void 0},void 0)}}function qS(n,r){const a={};let u,s;for(s in r.properties)if(s!=="children"&&Kd.call(r.properties,s)){const d=VS(n,s,r.properties[s]);if(d){const[f,m]=d;n.tableCellAlignToStyle&&f==="align"&&typeof m=="string"&&AS.has(r.tagName)?u=m:a[f]=m}}if(u){const d=a.style||(a.style={});d[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=u}return a}function FS(n,r){const a={};for(const u of r.attributes)if(u.type==="mdxJsxExpressionAttribute")if(u.data&&u.data.estree&&n.evaluater){const d=u.data.estree.body[0];d.type;const f=d.expression;f.type;const m=f.properties[0];m.type,Object.assign(a,n.evaluater.evaluateExpression(m.argument))}else uu(n,r.position);else{const{name:s}=u;let d;if(u.value&&typeof u.value=="object")if(u.value.data&&u.value.data.estree&&n.evaluater){const m=u.value.data.estree.body[0];m.type,d=n.evaluater.evaluateExpression(m.expression)}else uu(n,r.position);else d=u.value===null?!0:u.value;a[s]=d}return a}function $d(n,r){const a=[];let u=-1;const s=n.passKeys?new Map:jS;for(;++us?0:s+r:r=r>s?s:r,a=a>0?a:0,u.length<1e4)f=Array.from(u),f.unshift(r,a),n.splice(...f);else for(a&&n.splice(r,a);d0?(el(n,n.length,0,r),n):r}const ly={}.hasOwnProperty;function bb(n){const r={};let a=-1;for(;++a13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function tl(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Pt=ki(/[A-Za-z]/),Wt=ki(/[\dA-Za-z]/),PS=ki(/[#-'*+\--9=?A-Z^-~]/);function is(n){return n!==null&&(n<32||n===127)}const Td=ki(/\d/),WS=ki(/[\dA-Fa-f]/),wb=ki(/[!-/:-@[-`{-~]/);function Te(n){return n!==null&&n<-2}function mt(n){return n!==null&&(n<0||n===32)}function Ve(n){return n===-2||n===-1||n===32}const fs=ki(new RegExp("\\p{P}|\\p{S}","u")),tr=ki(/\s/);function ki(n){return r;function r(a){return a!==null&&a>-1&&n.test(String.fromCharCode(a))}}function ta(n){const r=[];let a=-1,u=0,s=0;for(;++a55295&&d<57344){const m=n.charCodeAt(a+1);d<56320&&m>56319&&m<57344?(f=String.fromCharCode(d,m),s=1):f="�"}else f=String.fromCharCode(d);f&&(r.push(n.slice(u,a),encodeURIComponent(f)),u=a+s+1,f=""),s&&(a+=s,s=0)}return r.join("")+n.slice(u)}function et(n,r,a,u){const s=u?u-1:1/0;let d=0;return f;function f(p){return Ve(p)?(n.enter(a),m(p)):r(p)}function m(p){return Ve(p)&&d++=s?r(y):a(y)}}const eN={tokenize:tN};function tN(n){const r=n.attempt(this.parser.constructs.contentInitial,u,s);let a;return r;function u(m){if(m===null){n.consume(m);return}return n.enter("lineEnding"),n.consume(m),n.exit("lineEnding"),et(n,r,"linePrefix")}function s(m){return n.enter("paragraph"),d(m)}function d(m){const p=n.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=p),a=p,f(m)}function f(m){if(m===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(m);return}return Te(m)?(n.consume(m),n.exit("chunkText"),d):(n.consume(m),f)}}let rs=class{constructor(){this.index=new Map,this.map=[]}add(r,a,u){iy(this,r,a,u,!1)}addBefore(r,a,u){iy(this,r,a,u,!0)}consume(r){if(this.map.sort(function(d,f){return d[0]-f[0]}),this.map.length===0)return;let a=this.map.length;const u=[];for(;a>0;)a-=1,u.push(r.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),r.length=this.map[a][0];u.push(r.slice()),r.length=0;let s=u.pop();for(;s;){for(const d of s)r.push(d);s=u.pop()}this.map.length=0,this.index.clear()}};function iy(n,r,a,u,s){if(a===0&&u.length===0)return;const d=n.index.get(r);if(d){d[1]+=a,s?(u.push(...d[2]),d[2]=u):d[2].push(...u);return}const f=[r,a,u];n.map.push(f),n.index.set(r,f)}const nN={tokenize:lN},ry={tokenize:iN};function lN(n){const r=this,a=[];let u=0,s,d,f;return m;function m(I){if(uf))return;const R=r.events.length;let Q=R,fe,B;for(;Q--;)if(r.events[Q][0]==="exit"&&r.events[Q][1].type==="chunkFlow"){if(fe){B=r.events[Q][1].end;break}fe=!0}for(D(u),U=R;UI;){const ie=a[J];r.containerState=ie[1],ie[0].exit.call(r,n)}a.length=I}function $(){s.write([null]),d=void 0,s=void 0,r.containerState._closeFlow=void 0}}function iN(n,r,a){return et(n,n.attempt(this.parser.constructs.document,r,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wi(n){if(n===null||mt(n)||tr(n))return 1;if(fs(n))return 2}function ds(n,r,a){const u=[];let s=-1;for(;++s1&&n[a][1].end.offset-n[a][1].start.offset>1?2:1,f={...n[s][1].end},m={...n[a][1].start};ay(f,-d),ay(m,d);const p={type:d>1?"strongSequence":"emphasisSequence",start:f,end:{...n[s][1].end}},x={type:d>1?"strongSequence":"emphasisSequence",start:{...n[a][1].start},end:m},y={type:d>1?"strongText":"emphasisText",start:{...n[s][1].end},end:{...n[a][1].start}},g={type:d>1?"strong":"emphasis",start:{...p.start},end:{...x.end}};n[s][1].end={...p.start},n[a][1].start={...x.end},u=[],n[s][1].end.offset-n[s][1].start.offset&&(u=Yn(u,[["enter",n[s][1],r],["exit",n[s][1],r]])),u=Yn(u,[["enter",g,r],["enter",p,r],["exit",p,r],["enter",y,r]]),u=Yn(u,ds(r.parser.constructs.insideSpan.null,n.slice(s+1,a),r)),u=Yn(u,[["exit",y,r],["enter",x,r],["exit",x,r],["exit",g,r]]);let w=0;n[a][1].end.offset-n[a][1].start.offset&&(w=2,u=Yn(u,[["enter",n[a][1],r],["exit",n[a][1],r]])),el(n,s-1,a-s+3,u),a=s+u.length-w-2;break}}for(a=-1;++a0&&Ve(U)?et(n,$,"linePrefix",d+1)(U):$(U)}function $(U){return U===null||Te(U)?n.check(Ad,T,J)(U):(n.enter("codeFlowValue"),I(U))}function I(U){return U===null||Te(U)?(n.exit("codeFlowValue"),$(U)):(n.consume(U),I)}function J(U){return n.exit("codeFenced"),r(U)}function ie(U,R,Q){let fe=0;return B;function B(ae){return U.enter("lineEnding"),U.consume(ae),U.exit("lineEnding"),ne}function ne(ae){return U.enter("codeFencedFence"),Ve(ae)?et(U,V,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ae):V(ae)}function V(ae){return ae===m?(U.enter("codeFencedFenceSequence"),se(ae)):Q(ae)}function se(ae){return ae===m?(fe++,U.consume(ae),se):fe>=f?(U.exit("codeFencedFenceSequence"),Ve(ae)?et(U,ve,"whitespace")(ae):ve(ae)):Q(ae)}function ve(ae){return ae===null||Te(ae)?(U.exit("codeFencedFence"),R(ae)):Q(ae)}}}const id={name:"codeIndented",tokenize:yN},xN={partial:!0,tokenize:bN};function yN(n,r,a){return u;function u(m){return n.enter("codeIndented"),kb(n,s,a,"linePrefix",4,4)(m)}function s(m){return m===null?f(m):Te(m)?n.attempt(xN,s,f)(m):(n.enter("codeFlowValue"),d(m))}function d(m){return m===null||Te(m)?(n.exit("codeFlowValue"),s(m)):(n.consume(m),d)}function f(m){return n.exit("codeIndented"),r(m)}}function bN(n,r,a){const u=this;return s;function s(f){return u.parser.lazy[u.now().line]?a(f):Te(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),s):kb(n,r,d,"linePrefix",4,4)(f)}function d(f){return Te(f)?s(f):a(f)}}const vN={name:"codeText",previous:kN,resolve:wN,tokenize:SN};function wN(n){let r=n.length-4,a=3,u,s;if((n[a][1].type==="lineEnding"||n[a][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(u=a;++u=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return rthis.left.length?this.right.slice(this.right.length-u+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-u+this.left.length).reverse())}splice(r,a,u){const s=a||0;this.setCursor(Math.trunc(r));const d=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return u&&Wa(this.left,u),d.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),Wa(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Wa(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r=4?r(f):n.interrupt(u.parser.constructs.flow,a,r)(f)}}function Cb(n,r,a,u,s,d,f,m,p){const x=p||Number.POSITIVE_INFINITY;let y=0;return g;function g(D){return D===60?(n.enter(u),n.enter(s),n.enter(d),n.consume(D),n.exit(d),w):D===null||D===32||D===41||is(D)?a(D):(n.enter(u),n.enter(f),n.enter(m),n.enter("chunkString",{contentType:"string"}),T(D))}function w(D){return D===62?(n.enter(d),n.consume(D),n.exit(d),n.exit(s),n.exit(u),r):(n.enter(m),n.enter("chunkString",{contentType:"string"}),v(D))}function v(D){return D===62?(n.exit("chunkString"),n.exit(m),w(D)):D===null||D===60||Te(D)?a(D):(n.consume(D),D===92?S:v)}function S(D){return D===60||D===62||D===92?(n.consume(D),v):v(D)}function T(D){return!y&&(D===null||D===41||mt(D))?(n.exit("chunkString"),n.exit(m),n.exit(f),n.exit(u),r(D)):y999||v===null||v===91||v===93&&!p||v===94&&!m&&"_hiddenFootnoteSupport"in f.parser.constructs?a(v):v===93?(n.exit(d),n.enter(s),n.consume(v),n.exit(s),n.exit(u),r):Te(v)?(n.enter("lineEnding"),n.consume(v),n.exit("lineEnding"),y):(n.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||v===91||v===93||Te(v)||m++>999?(n.exit("chunkString"),y(v)):(n.consume(v),p||(p=!Ve(v)),v===92?w:g)}function w(v){return v===91||v===92||v===93?(n.consume(v),m++,g):g(v)}}function _b(n,r,a,u,s,d){let f;return m;function m(w){return w===34||w===39||w===40?(n.enter(u),n.enter(s),n.consume(w),n.exit(s),f=w===40?41:w,p):a(w)}function p(w){return w===f?(n.enter(s),n.consume(w),n.exit(s),n.exit(u),r):(n.enter(d),x(w))}function x(w){return w===f?(n.exit(d),p(f)):w===null?a(w):Te(w)?(n.enter("lineEnding"),n.consume(w),n.exit("lineEnding"),et(n,x,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),y(w))}function y(w){return w===f||w===null||Te(w)?(n.exit("chunkString"),x(w)):(n.consume(w),w===92?g:y)}function g(w){return w===f||w===92?(n.consume(w),y):y(w)}}function ru(n,r){let a;return u;function u(s){return Te(s)?(n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),a=!0,u):Ve(s)?et(n,u,a?"linePrefix":"lineSuffix")(s):r(s)}}const zN={name:"definition",tokenize:MN},DN={partial:!0,tokenize:ON};function MN(n,r,a){const u=this;let s;return d;function d(v){return n.enter("definition"),f(v)}function f(v){return Tb.call(u,n,m,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function m(v){return s=tl(u.sliceSerialize(u.events[u.events.length-1][1]).slice(1,-1)),v===58?(n.enter("definitionMarker"),n.consume(v),n.exit("definitionMarker"),p):a(v)}function p(v){return mt(v)?ru(n,x)(v):x(v)}function x(v){return Cb(n,y,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function y(v){return n.attempt(DN,g,g)(v)}function g(v){return Ve(v)?et(n,w,"whitespace")(v):w(v)}function w(v){return v===null||Te(v)?(n.exit("definition"),u.parser.defined.push(s),r(v)):a(v)}}function ON(n,r,a){return u;function u(m){return mt(m)?ru(n,s)(m):a(m)}function s(m){return _b(n,d,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(m)}function d(m){return Ve(m)?et(n,f,"whitespace")(m):f(m)}function f(m){return m===null||Te(m)?r(m):a(m)}}const RN={name:"hardBreakEscape",tokenize:LN};function LN(n,r,a){return u;function u(d){return n.enter("hardBreakEscape"),n.consume(d),s}function s(d){return Te(d)?(n.exit("hardBreakEscape"),r(d)):a(d)}}const UN={name:"headingAtx",resolve:BN,tokenize:HN};function BN(n,r){let a=n.length-2,u=3;if(n[u][1].type==="whitespace"&&(u+=2),a-2>u&&n[a][1].type==="whitespace"&&(a-=2),n[a][1].type==="atxHeadingSequence"&&(u===a-1||a-4>u&&n[a-2][1].type==="whitespace")&&(a-=u+1===a?2:4),a>u){const s={type:"atxHeadingText",start:n[u][1].start,end:n[a][1].end},d={type:"chunkText",start:n[u][1].start,end:n[a][1].end,contentType:"text"};el(n,u,a-u+1,[["enter",s,r],["enter",d,r],["exit",d,r],["exit",s,r]])}return n}function HN(n,r,a){let u=0;return s;function s(y){return n.enter("atxHeading"),d(y)}function d(y){return n.enter("atxHeadingSequence"),f(y)}function f(y){return y===35&&u++<6?(n.consume(y),f):y===null||mt(y)?(n.exit("atxHeadingSequence"),m(y)):a(y)}function m(y){return y===35?(n.enter("atxHeadingSequence"),p(y)):y===null||Te(y)?(n.exit("atxHeading"),r(y)):Ve(y)?et(n,m,"whitespace")(y):(n.enter("atxHeadingText"),x(y))}function p(y){return y===35?(n.consume(y),p):(n.exit("atxHeadingSequence"),m(y))}function x(y){return y===null||y===35||mt(y)?(n.exit("atxHeadingText"),m(y)):(n.consume(y),x)}}const Ab=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],zd=["pre","script","style","textarea"],qN={concrete:!0,name:"htmlFlow",resolveTo:VN,tokenize:YN},FN={partial:!0,tokenize:GN};function VN(n){let r=n.length;for(;r--&&!(n[r][0]==="enter"&&n[r][1].type==="htmlFlow"););return r>1&&n[r-2][1].type==="linePrefix"&&(n[r][1].start=n[r-2][1].start,n[r+1][1].start=n[r-2][1].start,n.splice(r-2,2)),n}function YN(n,r,a){const u=this;let s,d,f,m,p;return x;function x(M){return y(M)}function y(M){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(M),g}function g(M){return M===33?(n.consume(M),w):M===47?(n.consume(M),d=!0,T):M===63?(n.consume(M),s=3,u.interrupt?r:N):Pt(M)?(n.consume(M),f=String.fromCharCode(M),L):a(M)}function w(M){return M===45?(n.consume(M),s=2,v):M===91?(n.consume(M),s=5,m=0,S):Pt(M)?(n.consume(M),s=4,u.interrupt?r:N):a(M)}function v(M){return M===45?(n.consume(M),u.interrupt?r:N):a(M)}function S(M){const E="CDATA[";return M===E.charCodeAt(m++)?(n.consume(M),m===E.length?u.interrupt?r:V:S):a(M)}function T(M){return Pt(M)?(n.consume(M),f=String.fromCharCode(M),L):a(M)}function L(M){if(M===null||M===47||M===62||mt(M)){const E=M===47,Y=f.toLowerCase();return!E&&!d&&zd.includes(Y)?(s=1,u.interrupt?r(M):V(M)):Ab.includes(f.toLowerCase())?(s=6,E?(n.consume(M),D):u.interrupt?r(M):V(M)):(s=7,u.interrupt&&!u.parser.lazy[u.now().line]?a(M):d?$(M):I(M))}return M===45||Wt(M)?(n.consume(M),f+=String.fromCharCode(M),L):a(M)}function D(M){return M===62?(n.consume(M),u.interrupt?r:V):a(M)}function $(M){return Ve(M)?(n.consume(M),$):B(M)}function I(M){return M===47?(n.consume(M),B):M===58||M===95||Pt(M)?(n.consume(M),J):Ve(M)?(n.consume(M),I):B(M)}function J(M){return M===45||M===46||M===58||M===95||Wt(M)?(n.consume(M),J):ie(M)}function ie(M){return M===61?(n.consume(M),U):Ve(M)?(n.consume(M),ie):I(M)}function U(M){return M===null||M===60||M===61||M===62||M===96?a(M):M===34||M===39?(n.consume(M),p=M,R):Ve(M)?(n.consume(M),U):Q(M)}function R(M){return M===p?(n.consume(M),p=null,fe):M===null||Te(M)?a(M):(n.consume(M),R)}function Q(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||mt(M)?ie(M):(n.consume(M),Q)}function fe(M){return M===47||M===62||Ve(M)?I(M):a(M)}function B(M){return M===62?(n.consume(M),ne):a(M)}function ne(M){return M===null||Te(M)?V(M):Ve(M)?(n.consume(M),ne):a(M)}function V(M){return M===45&&s===2?(n.consume(M),A):M===60&&s===1?(n.consume(M),W):M===62&&s===4?(n.consume(M),qe):M===63&&s===3?(n.consume(M),N):M===93&&s===5?(n.consume(M),re):Te(M)&&(s===6||s===7)?(n.exit("htmlFlowData"),n.check(FN,Ge,se)(M)):M===null||Te(M)?(n.exit("htmlFlowData"),se(M)):(n.consume(M),V)}function se(M){return n.check(Ad,ve,Ge)(M)}function ve(M){return n.enter("lineEnding"),n.consume(M),n.exit("lineEnding"),ae}function ae(M){return M===null||Te(M)?se(M):(n.enter("htmlFlowData"),V(M))}function A(M){return M===45?(n.consume(M),N):V(M)}function W(M){return M===47?(n.consume(M),f="",le):V(M)}function le(M){if(M===62){const E=f.toLowerCase();return zd.includes(E)?(n.consume(M),qe):V(M)}return Pt(M)&&f.length<8?(n.consume(M),f+=String.fromCharCode(M),le):V(M)}function re(M){return M===93?(n.consume(M),N):V(M)}function N(M){return M===62?(n.consume(M),qe):M===45&&s===2?(n.consume(M),N):V(M)}function qe(M){return M===null||Te(M)?(n.exit("htmlFlowData"),Ge(M)):(n.consume(M),qe)}function Ge(M){return n.exit("htmlFlow"),r(M)}}function GN(n,r,a){return u;function u(s){return n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),n.attempt(su,r,a)}}const QN={name:"htmlText",tokenize:XN};function XN(n,r,a){const u=this;let s,d,f;return m;function m(N){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(N),p}function p(N){return N===33?(n.consume(N),x):N===47?(n.consume(N),ie):N===63?(n.consume(N),I):Pt(N)?(n.consume(N),Q):a(N)}function x(N){return N===45?(n.consume(N),y):N===91?(n.consume(N),d=0,S):Pt(N)?(n.consume(N),$):a(N)}function y(N){return N===45?(n.consume(N),v):a(N)}function g(N){return N===null?a(N):N===45?(n.consume(N),w):Te(N)?(f=g,W(N)):(n.consume(N),g)}function w(N){return N===45?(n.consume(N),v):g(N)}function v(N){return N===62?A(N):N===45?w(N):g(N)}function S(N){const qe="CDATA[";return N===qe.charCodeAt(d++)?(n.consume(N),d===qe.length?T:S):a(N)}function T(N){return N===null?a(N):N===93?(n.consume(N),L):Te(N)?(f=T,W(N)):(n.consume(N),T)}function L(N){return N===93?(n.consume(N),D):T(N)}function D(N){return N===62?A(N):N===93?(n.consume(N),D):T(N)}function $(N){return N===null||N===62?A(N):Te(N)?(f=$,W(N)):(n.consume(N),$)}function I(N){return N===null?a(N):N===63?(n.consume(N),J):Te(N)?(f=I,W(N)):(n.consume(N),I)}function J(N){return N===62?A(N):I(N)}function ie(N){return Pt(N)?(n.consume(N),U):a(N)}function U(N){return N===45||Wt(N)?(n.consume(N),U):R(N)}function R(N){return Te(N)?(f=R,W(N)):Ve(N)?(n.consume(N),R):A(N)}function Q(N){return N===45||Wt(N)?(n.consume(N),Q):N===47||N===62||mt(N)?fe(N):a(N)}function fe(N){return N===47?(n.consume(N),A):N===58||N===95||Pt(N)?(n.consume(N),B):Te(N)?(f=fe,W(N)):Ve(N)?(n.consume(N),fe):A(N)}function B(N){return N===45||N===46||N===58||N===95||Wt(N)?(n.consume(N),B):ne(N)}function ne(N){return N===61?(n.consume(N),V):Te(N)?(f=ne,W(N)):Ve(N)?(n.consume(N),ne):fe(N)}function V(N){return N===null||N===60||N===61||N===62||N===96?a(N):N===34||N===39?(n.consume(N),s=N,se):Te(N)?(f=V,W(N)):Ve(N)?(n.consume(N),V):(n.consume(N),ve)}function se(N){return N===s?(n.consume(N),s=void 0,ae):N===null?a(N):Te(N)?(f=se,W(N)):(n.consume(N),se)}function ve(N){return N===null||N===34||N===39||N===60||N===61||N===96?a(N):N===47||N===62||mt(N)?fe(N):(n.consume(N),ve)}function ae(N){return N===47||N===62||mt(N)?fe(N):a(N)}function A(N){return N===62?(n.consume(N),n.exit("htmlTextData"),n.exit("htmlText"),r):a(N)}function W(N){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(N),n.exit("lineEnding"),le}function le(N){return Ve(N)?et(n,re,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):re(N)}function re(N){return n.enter("htmlTextData"),f(N)}}const Wd={name:"labelEnd",resolveAll:$N,resolveTo:JN,tokenize:PN},IN={tokenize:WN},KN={tokenize:e3},ZN={tokenize:t3};function $N(n){let r=-1;const a=[];for(;++r0&&s[s.length-1]._balanced;)s.pop();d=s[s.length-1]}return m;function m(w){return d?d._inactive?g(w):(f=u.parser.defined.includes(tl(u.sliceSerialize({start:d.end,end:u.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(w),n.exit("labelMarker"),n.exit("labelEnd"),p):a(w)}function p(w){return w===40?n.attempt(IN,y,f?y:g)(w):w===91?n.attempt(KN,y,f?x:g)(w):f?y(w):g(w)}function x(w){return n.attempt(ZN,y,g)(w)}function y(w){return s.pop(),r(w)}function g(w){return d._balanced=!0,a(w)}}function WN(n,r,a){return u;function u(g){return n.enter("resource"),n.enter("resourceMarker"),n.consume(g),n.exit("resourceMarker"),s}function s(g){return mt(g)?ru(n,d)(g):d(g)}function d(g){return g===41?y(g):Cb(n,f,m,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function f(g){return mt(g)?ru(n,p)(g):y(g)}function m(g){return a(g)}function p(g){return g===34||g===39||g===40?_b(n,x,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function x(g){return mt(g)?ru(n,y)(g):y(g)}function y(g){return g===41?(n.enter("resourceMarker"),n.consume(g),n.exit("resourceMarker"),n.exit("resource"),r):a(g)}}function e3(n,r,a){const u=this;return s;function s(m){return Tb.call(u,n,d,f,"reference","referenceMarker","referenceString")(m)}function d(m){return u.parser.defined.includes(tl(u.sliceSerialize(u.events[u.events.length-1][1]).slice(1,-1)))?r(m):a(m)}function f(m){return a(m)}}function t3(n,r,a){return u;function u(d){return n.enter("reference"),n.enter("referenceMarker"),n.consume(d),n.exit("referenceMarker"),s}function s(d){return d===93?(n.enter("referenceMarker"),n.consume(d),n.exit("referenceMarker"),n.exit("reference"),r):a(d)}}const n3={name:"labelStartImage",resolveAll:Wd.resolveAll,tokenize:l3};function l3(n,r,a){const u=this;let s;return d;function d(p){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(p),n.exit("labelImageMarker"),f}function f(p){return p===91?(n.enter("labelMarker"),n.consume(p),n.exit("labelMarker"),s=n.exit("labelImage"),m):a(p)}function m(p){return p===94&&"_hiddenFootnoteSupport"in u.parser.constructs?a(p):(u._labelStarts=u._labelStarts||[],u._labelStarts.push(s),r(p))}}const i3={name:"labelStartLink",resolveAll:Wd.resolveAll,tokenize:r3};function r3(n,r,a){const u=this;let s;return d;function d(m){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(m),n.exit("labelMarker"),s=n.exit("labelLink"),f}function f(m){return m===94&&"_hiddenFootnoteSupport"in u.parser.constructs?a(m):(u._labelStarts=u._labelStarts||[],u._labelStarts.push(s),r(m))}}const rd={name:"lineEnding",tokenize:a3};function a3(n,r){return a;function a(u){return n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),et(n,r,"linePrefix")}}const ts={name:"thematicBreak",tokenize:u3};function u3(n,r,a){let u=0,s;return d;function d(x){return n.enter("thematicBreak"),f(x)}function f(x){return s=x,m(x)}function m(x){return x===s?(n.enter("thematicBreakSequence"),p(x)):u>=3&&(x===null||Te(x))?(n.exit("thematicBreak"),r(x)):a(x)}function p(x){return x===s?(n.consume(x),u++,p):(n.exit("thematicBreakSequence"),Ve(x)?et(n,m,"whitespace")(x):m(x))}}const xn={continuation:{tokenize:f3},exit:h3,name:"list",tokenize:c3},o3={partial:!0,tokenize:m3},s3={partial:!0,tokenize:d3};function c3(n,r,a){const u=this,s=u.events[u.events.length-1];let d=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,f=0;return m;function m(v){const S=u.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!u.containerState.marker||v===u.containerState.marker:Td(v)){if(u.containerState.type||(u.containerState.type=S,n.enter(S,{_container:!0})),S==="listUnordered")return n.enter("listItemPrefix"),v===42||v===45?n.check(ts,a,x)(v):x(v);if(!u.interrupt||v===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),p(v)}return a(v)}function p(v){return Td(v)&&++f<10?(n.consume(v),p):(!u.interrupt||f<2)&&(u.containerState.marker?v===u.containerState.marker:v===41||v===46)?(n.exit("listItemValue"),x(v)):a(v)}function x(v){return n.enter("listItemMarker"),n.consume(v),n.exit("listItemMarker"),u.containerState.marker=u.containerState.marker||v,n.check(su,u.interrupt?a:y,n.attempt(o3,w,g))}function y(v){return u.containerState.initialBlankLine=!0,d++,w(v)}function g(v){return Ve(v)?(n.enter("listItemPrefixWhitespace"),n.consume(v),n.exit("listItemPrefixWhitespace"),w):a(v)}function w(v){return u.containerState.size=d+u.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(v)}}function f3(n,r,a){const u=this;return u.containerState._closeFlow=void 0,n.check(su,s,d);function s(m){return u.containerState.furtherBlankLines=u.containerState.furtherBlankLines||u.containerState.initialBlankLine,et(n,r,"listItemIndent",u.containerState.size+1)(m)}function d(m){return u.containerState.furtherBlankLines||!Ve(m)?(u.containerState.furtherBlankLines=void 0,u.containerState.initialBlankLine=void 0,f(m)):(u.containerState.furtherBlankLines=void 0,u.containerState.initialBlankLine=void 0,n.attempt(s3,r,f)(m))}function f(m){return u.containerState._closeFlow=!0,u.interrupt=void 0,et(n,n.attempt(xn,r,a),"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m)}}function d3(n,r,a){const u=this;return et(n,s,"listItemIndent",u.containerState.size+1);function s(d){const f=u.events[u.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===u.containerState.size?r(d):a(d)}}function h3(n){n.exit(this.containerState.type)}function m3(n,r,a){const u=this;return et(n,s,"listItemPrefixWhitespace",u.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(d){const f=u.events[u.events.length-1];return!Ve(d)&&f&&f[1].type==="listItemPrefixWhitespace"?r(d):a(d)}}const oy={name:"setextUnderline",resolveTo:p3,tokenize:g3};function p3(n,r){const a=new rs;let u=n.length,s,d,f;for(;u--;)if(n[u][0]==="enter"){if(n[u][1].type==="content"){s=u;break}n[u][1].type==="paragraph"&&(d=u)}else n[u][1].type==="content"&&a.add(u,1,[]),!f&&n[u][1].type==="definition"&&(f=u);const m={type:"setextHeading",start:{...n[s][1].start},end:{...n[n.length-1][1].end}};return n[d][1].type="setextHeadingText",f?(a.add(d,0,[["enter",m,r]]),a.add(f+1,0,[["exit",n[s][1],r]]),n[s][1].end={...n[f][1].end}):n[s][1]=m,a.add(n.length,0,[["exit",m,r]]),a.consume(n),n}function g3(n,r,a){const u=this;let s;return d;function d(x){let y=u.events.length,g;for(;y--;)if(u.events[y][1].type!=="lineEnding"&&u.events[y][1].type!=="linePrefix"&&u.events[y][1].type!=="content"){g=u.events[y][1].type==="paragraph";break}return!u.parser.lazy[u.now().line]&&(u.interrupt||g)?(n.enter("setextHeadingLine"),s=x,f(x)):a(x)}function f(x){return n.enter("setextHeadingLineSequence"),m(x)}function m(x){return x===s?(n.consume(x),m):(n.exit("setextHeadingLineSequence"),Ve(x)?et(n,p,"lineSuffix")(x):p(x))}function p(x){return x===null||Te(x)?(n.exit("setextHeadingLine"),r(x)):a(x)}}const x3={tokenize:y3};function y3(n){const r=this,a=n.attempt(su,u,n.attempt(this.parser.constructs.flowInitial,s,et(n,n.attempt(this.parser.constructs.flow,s,n.attempt(jN,s)),"linePrefix")));return a;function u(d){if(d===null){n.consume(d);return}return n.enter("lineEndingBlank"),n.consume(d),n.exit("lineEndingBlank"),r.currentConstruct=void 0,a}function s(d){if(d===null){n.consume(d);return}return n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),r.currentConstruct=void 0,a}}const b3={resolveAll:Db()},v3=zb("string"),w3=zb("text");function zb(n){return{resolveAll:Db(n==="text"?k3:void 0),tokenize:r};function r(a){const u=this,s=this.parser.constructs[n],d=a.attempt(s,f,m);return f;function f(y){return x(y)?d(y):m(y)}function m(y){if(y===null){a.consume(y);return}return a.enter("data"),a.consume(y),p}function p(y){return x(y)?(a.exit("data"),d(y)):(a.consume(y),p)}function x(y){if(y===null)return!0;const g=s[y];let w=-1;if(g)for(;++w-1){const m=f[0];typeof m=="string"?f[0]=m.slice(u):f.shift()}d>0&&f.push(n[s].slice(0,d))}return f}function R3(n,r){let a=-1;const u=[];let s;for(;++a0&&s(r.beforeEnter,{...ke,sliceSerialize:K[it][2].sliceSerialize},K[it][1]),Db.call(Tt,K[it][1].type)&&Tt[K[it][1].type].call({...ke,sliceSerialize:K[it][2].sliceSerialize},K[it][1]),K[it][0]==="exit"&&r.afterExit.length>0&&s(r.afterExit,{...ke,sliceSerialize:K[it][2].sliceSerialize},K[it][1])}if(ke.tokenStack.length>0){const Tt=ke.tokenStack[ke.tokenStack.length-1];(Tt[1]||cy).call(ke,void 0,Tt[0])}for(ue.position={start:yi(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:yi(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},it=-1;++it0&&(u.className=["language-"+s[0]]);let d={type:"element",tagName:"code",properties:u,children:[{type:"text",value:a}]};return r.meta&&(d.data={meta:r.meta}),n.patch(r,d),d=n.applyData(r,d),d={type:"element",tagName:"pre",properties:{},children:[d]},n.patch(r,d),d}function K3(n,r){const a={type:"element",tagName:"del",properties:{},children:n.all(r)};return n.patch(r,a),n.applyData(r,a)}function Z3(n,r){const a={type:"element",tagName:"em",properties:{},children:n.all(r)};return n.patch(r,a),n.applyData(r,a)}function $3(n,r){const a=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",u=String(r.identifier).toUpperCase(),s=ta(u.toLowerCase()),d=n.footnoteOrder.indexOf(u);let f,m=n.footnoteCounts.get(u);m===void 0?(m=0,n.footnoteOrder.push(u),f=n.footnoteOrder.length):f=d+1,m+=1,n.footnoteCounts.set(u,m);const p={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+s,id:a+"fnref-"+s+(m>1?"-"+m:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};n.patch(r,p);const x={type:"element",tagName:"sup",properties:{},children:[p]};return n.patch(r,x),n.applyData(r,x)}function J3(n,r){const a={type:"element",tagName:"h"+r.depth,properties:{},children:n.all(r)};return n.patch(r,a),n.applyData(r,a)}function P3(n,r){if(n.options.allowDangerousHtml){const a={type:"raw",value:r.value};return n.patch(r,a),n.applyData(r,a)}}function Ob(n,r){const a=r.referenceType;let u="]";if(a==="collapsed"?u+="[]":a==="full"&&(u+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+u}];const s=n.all(r),d=s[0];d&&d.type==="text"?d.value="["+d.value:s.unshift({type:"text",value:"["});const f=s[s.length-1];return f&&f.type==="text"?f.value+=u:s.push({type:"text",value:u}),s}function W3(n,r){const a=String(r.identifier).toUpperCase(),u=n.definitionById.get(a);if(!u)return Ob(n,r);const s={src:ta(u.url||""),alt:r.alt};u.title!==null&&u.title!==void 0&&(s.title=u.title);const d={type:"element",tagName:"img",properties:s,children:[]};return n.patch(r,d),n.applyData(r,d)}function eE(n,r){const a={src:ta(r.url)};r.alt!==null&&r.alt!==void 0&&(a.alt=r.alt),r.title!==null&&r.title!==void 0&&(a.title=r.title);const u={type:"element",tagName:"img",properties:a,children:[]};return n.patch(r,u),n.applyData(r,u)}function tE(n,r){const a={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};n.patch(r,a);const u={type:"element",tagName:"code",properties:{},children:[a]};return n.patch(r,u),n.applyData(r,u)}function nE(n,r){const a=String(r.identifier).toUpperCase(),u=n.definitionById.get(a);if(!u)return Ob(n,r);const s={href:ta(u.url||"")};u.title!==null&&u.title!==void 0&&(s.title=u.title);const d={type:"element",tagName:"a",properties:s,children:n.all(r)};return n.patch(r,d),n.applyData(r,d)}function lE(n,r){const a={href:ta(r.url)};r.title!==null&&r.title!==void 0&&(a.title=r.title);const u={type:"element",tagName:"a",properties:a,children:n.all(r)};return n.patch(r,u),n.applyData(r,u)}function iE(n,r,a){const u=n.all(r),s=a?rE(a):Rb(r),d={},f=[];if(typeof r.checked=="boolean"){const y=u[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},u.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),d.className=["task-list-item"]}let m=-1;for(;++m0&&s(r.beforeEnter,{...ke,sliceSerialize:K[it][2].sliceSerialize},K[it][1]),Mb.call(Tt,K[it][1].type)&&Tt[K[it][1].type].call({...ke,sliceSerialize:K[it][2].sliceSerialize},K[it][1]),K[it][0]==="exit"&&r.afterExit.length>0&&s(r.afterExit,{...ke,sliceSerialize:K[it][2].sliceSerialize},K[it][1])}if(ke.tokenStack.length>0){const Tt=ke.tokenStack[ke.tokenStack.length-1];(Tt[1]||cy).call(ke,void 0,Tt[0])}for(ue.position={start:yi(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:yi(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},it=-1;++it0&&(u.className=["language-"+s[0]]);let d={type:"element",tagName:"code",properties:u,children:[{type:"text",value:a}]};return r.meta&&(d.data={meta:r.meta}),n.patch(r,d),d=n.applyData(r,d),d={type:"element",tagName:"pre",properties:{},children:[d]},n.patch(r,d),d}function Z3(n,r){const a={type:"element",tagName:"del",properties:{},children:n.all(r)};return n.patch(r,a),n.applyData(r,a)}function $3(n,r){const a={type:"element",tagName:"em",properties:{},children:n.all(r)};return n.patch(r,a),n.applyData(r,a)}function J3(n,r){const a=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",u=String(r.identifier).toUpperCase(),s=ta(u.toLowerCase()),d=n.footnoteOrder.indexOf(u);let f,m=n.footnoteCounts.get(u);m===void 0?(m=0,n.footnoteOrder.push(u),f=n.footnoteOrder.length):f=d+1,m+=1,n.footnoteCounts.set(u,m);const p={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+s,id:a+"fnref-"+s+(m>1?"-"+m:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};n.patch(r,p);const x={type:"element",tagName:"sup",properties:{},children:[p]};return n.patch(r,x),n.applyData(r,x)}function P3(n,r){const a={type:"element",tagName:"h"+r.depth,properties:{},children:n.all(r)};return n.patch(r,a),n.applyData(r,a)}function W3(n,r){if(n.options.allowDangerousHtml){const a={type:"raw",value:r.value};return n.patch(r,a),n.applyData(r,a)}}function Rb(n,r){const a=r.referenceType;let u="]";if(a==="collapsed"?u+="[]":a==="full"&&(u+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+u}];const s=n.all(r),d=s[0];d&&d.type==="text"?d.value="["+d.value:s.unshift({type:"text",value:"["});const f=s[s.length-1];return f&&f.type==="text"?f.value+=u:s.push({type:"text",value:u}),s}function eE(n,r){const a=String(r.identifier).toUpperCase(),u=n.definitionById.get(a);if(!u)return Rb(n,r);const s={src:ta(u.url||""),alt:r.alt};u.title!==null&&u.title!==void 0&&(s.title=u.title);const d={type:"element",tagName:"img",properties:s,children:[]};return n.patch(r,d),n.applyData(r,d)}function tE(n,r){const a={src:ta(r.url)};r.alt!==null&&r.alt!==void 0&&(a.alt=r.alt),r.title!==null&&r.title!==void 0&&(a.title=r.title);const u={type:"element",tagName:"img",properties:a,children:[]};return n.patch(r,u),n.applyData(r,u)}function nE(n,r){const a={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};n.patch(r,a);const u={type:"element",tagName:"code",properties:{},children:[a]};return n.patch(r,u),n.applyData(r,u)}function lE(n,r){const a=String(r.identifier).toUpperCase(),u=n.definitionById.get(a);if(!u)return Rb(n,r);const s={href:ta(u.url||"")};u.title!==null&&u.title!==void 0&&(s.title=u.title);const d={type:"element",tagName:"a",properties:s,children:n.all(r)};return n.patch(r,d),n.applyData(r,d)}function iE(n,r){const a={href:ta(r.url)};r.title!==null&&r.title!==void 0&&(a.title=r.title);const u={type:"element",tagName:"a",properties:a,children:n.all(r)};return n.patch(r,u),n.applyData(r,u)}function rE(n,r,a){const u=n.all(r),s=a?aE(a):Lb(r),d={},f=[];if(typeof r.checked=="boolean"){const y=u[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},u.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),d.className=["task-list-item"]}let m=-1;for(;++m1}function aE(n,r){const a={},u=n.all(r);let s=-1;for(typeof r.start=="number"&&r.start!==1&&(a.start=r.start);++s0){const f={type:"element",tagName:"tbody",properties:{},children:n.wrap(a,!0)},m=Id(r.children[1]),p=fb(r.children[r.children.length-1]);m&&p&&(f.position={start:m,end:p}),s.push(f)}const d={type:"element",tagName:"table",properties:{},children:n.wrap(s,!0)};return n.patch(r,d),n.applyData(r,d)}function fE(n,r,a){const u=a?a.children:void 0,d=(u?u.indexOf(r):1)===0?"th":"td",f=a&&a.type==="table"?a.align:void 0,m=f?f.length:r.children.length;let p=-1;const x=[];for(;++p0,!0),u[0]),s=u.index+u[0].length,u=a.exec(r);return d.push(hy(r.slice(s),s>0,!1)),d.join("")}function hy(n,r,a){let u=0,s=n.length;if(r){let d=n.codePointAt(u);for(;d===fy||d===dy;)u++,d=n.codePointAt(u)}if(a){let d=n.codePointAt(s-1);for(;d===fy||d===dy;)s--,d=n.codePointAt(s-1)}return s>u?n.slice(u,s):""}function mE(n,r){const a={type:"text",value:hE(String(r.value))};return n.patch(r,a),n.applyData(r,a)}function pE(n,r){const a={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(r,a),n.applyData(r,a)}const gE={blockquote:Q3,break:X3,code:I3,delete:K3,emphasis:Z3,footnoteReference:$3,heading:J3,html:P3,imageReference:W3,image:eE,inlineCode:tE,linkReference:nE,link:lE,listItem:iE,list:aE,paragraph:uE,root:oE,strong:sE,table:cE,tableCell:dE,tableRow:fE,text:mE,thematicBreak:pE,toml:Qo,yaml:Qo,definition:Qo,footnoteDefinition:Qo};function Qo(){}const Lb=-1,hs=0,au=1,as=2,eh=3,th=4,nh=5,lh=6,Ub=7,Bb=8,{defineProperty:xE}=Object,Hb=typeof self=="object"?self:globalThis,my=(n,r)=>{switch(n){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+n)}return new Hb[n](r)},yE=(n,r)=>{const a=(s,d)=>(n.set(d,s),s),u=s=>{if(n.has(s))return n.get(s);const[d,f]=r[s];switch(d){case hs:case Lb:return a(f,s);case au:{const m=a([],s);for(const p of f)m.push(u(p));return m}case as:{const m=a({},s);for(const[p,x]of f){const y=u(p),g=u(x);y==="__proto__"?xE(m,y,{value:g,configurable:!0,enumerable:!0,writable:!0}):m[y]=g}return m}case eh:return a(new Date(f),s);case th:{const{source:m,flags:p}=f;return a(new RegExp(m,p),s)}case nh:{const m=a(new Map,s);for(const[p,x]of f)m.set(u(p),u(x));return m}case lh:{const m=a(new Set,s);for(const p of f)m.add(u(p));return m}case Ub:{const{name:m,message:p}=f;return a(typeof Hb[m]=="function"?my(m,p):new Error(p),s)}case Bb:return a(BigInt(f),s);case"BigInt":return a(Object(BigInt(f)),s);case"ArrayBuffer":return a(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:m}=new Uint8Array(f);return a(new DataView(m),f)}case"-0":return-0}return a(my(d,f),s)};return u},py=n=>yE(new Map,n)(0),$i="",{toString:bE}={},{keys:vE,is:wE}=Object,eu=n=>{const r=typeof n;if(r!=="object"||!n)return[hs,r];const a=bE.call(n).slice(8,-1);switch(a){case"Array":return[au,$i];case"Object":return[as,$i];case"Date":return[eh,$i];case"RegExp":return[th,$i];case"Map":return[nh,$i];case"Set":return[lh,$i];case"DataView":return[au,a]}return a.includes("Array")?[au,a]:n instanceof Error?[Ub,n.name||"Error"]:[as,a]},Xo=([n,r])=>n===hs&&(r==="function"||r==="symbol"),kE=(n,r,a,u)=>{const s=(f,m)=>{const p=u.push(f)-1;return a.set(m,p),p},d=f=>{if(a.has(f))return a.get(f);let[m,p]=eu(f);switch(m){case hs:{let y=f;switch(p){case"bigint":m=Bb,y=f.toString();break;case"number":if(!f&&wE(f,-0))return u.push(["-0"])-1;break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+p);y=null;break;case"undefined":return s([Lb],f)}return s([m,y],f)}case au:{if(p){let w=f;return p==="DataView"?w=new Uint8Array(f.buffer):p==="ArrayBuffer"&&(w=new Uint8Array(f)),s([p,[...w]],f)}const y=[],g=s([m,y],f);for(const w of f)y.push(d(w));return g}case as:{if(p)switch(p){case"BigInt":return s([p,f.toString()],f);case"Boolean":case"Number":case"String":return s([p,f.valueOf()],f)}if(r&&"toJSON"in f)return d(f.toJSON());const y=[],g=s([m,y],f);for(const w of vE(f))(n||!Xo(eu(f[w])))&&y.push([d(w),d(f[w])]);return g}case eh:return s([m,isNaN(f.getTime())?$i:f.toISOString()],f);case th:{const{source:y,flags:g}=f;return s([m,{source:y,flags:g}],f)}case nh:{const y=[],g=s([m,y],f);for(const[w,v]of f)(n||!(Xo(eu(w))||Xo(eu(v))))&&y.push([d(w),d(v)]);return g}case lh:{const y=[],g=s([m,y],f);for(const w of f)(n||!Xo(eu(w)))&&y.push(d(w));return g}}const{message:x}=f;return s([m,{name:p,message:x}],f)};return d},gy=(n,{json:r,lossy:a}={})=>{const u=[];return kE(!(r||a),!!r,new Map,u)(n),u},us=typeof structuredClone=="function"?(n,r)=>r&&("json"in r||"lossy"in r)?py(gy(n,r)):structuredClone(n):(n,r)=>py(gy(n,r));function SE(n,r){const a=[{type:"text",value:"↩"}];return r>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),a}function NE(n,r){return"Back to reference "+(n+1)+(r>1?"-"+r:"")}function EE(n){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",a=n.options.footnoteBackContent||SE,u=n.options.footnoteBackLabel||NE,s=n.options.footnoteLabel||"Footnotes",d=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},m=[];let p=-1;for(;++p0&&S.push({type:"text",value:" "});let $=typeof a=="string"?a:a(p,v);typeof $=="string"&&($={type:"text",value:$}),S.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+w+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof u=="string"?u:u(p,v),className:["data-footnote-backref"]},children:Array.isArray($)?$:[$]})}const L=y[y.length-1];if(L&&L.type==="element"&&L.tagName==="p"){const $=L.children[L.children.length-1];$&&$.type==="text"?$.value+=" ":L.children.push({type:"text",value:" "}),L.children.push(...S)}else y.push(...S);const D={type:"element",tagName:"li",properties:{id:r+"fn-"+w},children:n.wrap(y,!0)};n.patch(x,D),m.push(D)}if(m.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:d,properties:{...us(f),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`});const x={type:"element",tagName:"li",properties:d,children:f};return n.patch(r,x),n.applyData(r,x)}function aE(n){let r=!1;if(n.type==="list"){r=n.spread||!1;const a=n.children;let u=-1;for(;!r&&++u1}function uE(n,r){const a={},u=n.all(r);let s=-1;for(typeof r.start=="number"&&r.start!==1&&(a.start=r.start);++s0){const f={type:"element",tagName:"tbody",properties:{},children:n.wrap(a,!0)},m=Id(r.children[1]),p=db(r.children[r.children.length-1]);m&&p&&(f.position={start:m,end:p}),s.push(f)}const d={type:"element",tagName:"table",properties:{},children:n.wrap(s,!0)};return n.patch(r,d),n.applyData(r,d)}function dE(n,r,a){const u=a?a.children:void 0,d=(u?u.indexOf(r):1)===0?"th":"td",f=a&&a.type==="table"?a.align:void 0,m=f?f.length:r.children.length;let p=-1;const x=[];for(;++p0,!0),u[0]),s=u.index+u[0].length,u=a.exec(r);return d.push(hy(r.slice(s),s>0,!1)),d.join("")}function hy(n,r,a){let u=0,s=n.length;if(r){let d=n.codePointAt(u);for(;d===fy||d===dy;)u++,d=n.codePointAt(u)}if(a){let d=n.codePointAt(s-1);for(;d===fy||d===dy;)s--,d=n.codePointAt(s-1)}return s>u?n.slice(u,s):""}function pE(n,r){const a={type:"text",value:mE(String(r.value))};return n.patch(r,a),n.applyData(r,a)}function gE(n,r){const a={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(r,a),n.applyData(r,a)}const xE={blockquote:X3,break:I3,code:K3,delete:Z3,emphasis:$3,footnoteReference:J3,heading:P3,html:W3,imageReference:eE,image:tE,inlineCode:nE,linkReference:lE,link:iE,listItem:rE,list:uE,paragraph:oE,root:sE,strong:cE,table:fE,tableCell:hE,tableRow:dE,text:pE,thematicBreak:gE,toml:Qo,yaml:Qo,definition:Qo,footnoteDefinition:Qo};function Qo(){}const Ub=-1,hs=0,au=1,as=2,eh=3,th=4,nh=5,lh=6,Bb=7,Hb=8,{defineProperty:yE}=Object,qb=typeof self=="object"?self:globalThis,my=(n,r)=>{switch(n){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+n)}return new qb[n](r)},bE=(n,r)=>{const a=(s,d)=>(n.set(d,s),s),u=s=>{if(n.has(s))return n.get(s);const[d,f]=r[s];switch(d){case hs:case Ub:return a(f,s);case au:{const m=a([],s);for(const p of f)m.push(u(p));return m}case as:{const m=a({},s);for(const[p,x]of f){const y=u(p),g=u(x);y==="__proto__"?yE(m,y,{value:g,configurable:!0,enumerable:!0,writable:!0}):m[y]=g}return m}case eh:return a(new Date(f),s);case th:{const{source:m,flags:p}=f;return a(new RegExp(m,p),s)}case nh:{const m=a(new Map,s);for(const[p,x]of f)m.set(u(p),u(x));return m}case lh:{const m=a(new Set,s);for(const p of f)m.add(u(p));return m}case Bb:{const{name:m,message:p}=f;return a(typeof qb[m]=="function"?my(m,p):new Error(p),s)}case Hb:return a(BigInt(f),s);case"BigInt":return a(Object(BigInt(f)),s);case"ArrayBuffer":return a(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:m}=new Uint8Array(f);return a(new DataView(m),f)}case"-0":return-0}return a(my(d,f),s)};return u},py=n=>bE(new Map,n)(0),$i="",{toString:vE}={},{keys:wE,is:kE}=Object,eu=n=>{const r=typeof n;if(r!=="object"||!n)return[hs,r];const a=vE.call(n).slice(8,-1);switch(a){case"Array":return[au,$i];case"Object":return[as,$i];case"Date":return[eh,$i];case"RegExp":return[th,$i];case"Map":return[nh,$i];case"Set":return[lh,$i];case"DataView":return[au,a]}return a.includes("Array")?[au,a]:n instanceof Error?[Bb,n.name||"Error"]:[as,a]},Xo=([n,r])=>n===hs&&(r==="function"||r==="symbol"),SE=(n,r,a,u)=>{const s=(f,m)=>{const p=u.push(f)-1;return a.set(m,p),p},d=f=>{if(a.has(f))return a.get(f);let[m,p]=eu(f);switch(m){case hs:{let y=f;switch(p){case"bigint":m=Hb,y=f.toString();break;case"number":if(!f&&kE(f,-0))return u.push(["-0"])-1;break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+p);y=null;break;case"undefined":return s([Ub],f)}return s([m,y],f)}case au:{if(p){let w=f;return p==="DataView"?w=new Uint8Array(f.buffer):p==="ArrayBuffer"&&(w=new Uint8Array(f)),s([p,[...w]],f)}const y=[],g=s([m,y],f);for(const w of f)y.push(d(w));return g}case as:{if(p)switch(p){case"BigInt":return s([p,f.toString()],f);case"Boolean":case"Number":case"String":return s([p,f.valueOf()],f)}if(r&&"toJSON"in f)return d(f.toJSON());const y=[],g=s([m,y],f);for(const w of wE(f))(n||!Xo(eu(f[w])))&&y.push([d(w),d(f[w])]);return g}case eh:return s([m,isNaN(f.getTime())?$i:f.toISOString()],f);case th:{const{source:y,flags:g}=f;return s([m,{source:y,flags:g}],f)}case nh:{const y=[],g=s([m,y],f);for(const[w,v]of f)(n||!(Xo(eu(w))||Xo(eu(v))))&&y.push([d(w),d(v)]);return g}case lh:{const y=[],g=s([m,y],f);for(const w of f)(n||!Xo(eu(w)))&&y.push(d(w));return g}}const{message:x}=f;return s([m,{name:p,message:x}],f)};return d},gy=(n,{json:r,lossy:a}={})=>{const u=[];return SE(!(r||a),!!r,new Map,u)(n),u},us=typeof structuredClone=="function"?(n,r)=>r&&("json"in r||"lossy"in r)?py(gy(n,r)):structuredClone(n):(n,r)=>py(gy(n,r));function NE(n,r){const a=[{type:"text",value:"↩"}];return r>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),a}function EE(n,r){return"Back to reference "+(n+1)+(r>1?"-"+r:"")}function jE(n){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",a=n.options.footnoteBackContent||NE,u=n.options.footnoteBackLabel||EE,s=n.options.footnoteLabel||"Footnotes",d=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},m=[];let p=-1;for(;++p0&&S.push({type:"text",value:" "});let $=typeof a=="string"?a:a(p,v);typeof $=="string"&&($={type:"text",value:$}),S.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+w+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof u=="string"?u:u(p,v),className:["data-footnote-backref"]},children:Array.isArray($)?$:[$]})}const L=y[y.length-1];if(L&&L.type==="element"&&L.tagName==="p"){const $=L.children[L.children.length-1];$&&$.type==="text"?$.value+=" ":L.children.push({type:"text",value:" "}),L.children.push(...S)}else y.push(...S);const D={type:"element",tagName:"li",properties:{id:r+"fn-"+w},children:n.wrap(y,!0)};n.patch(x,D),m.push(D)}if(m.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:d,properties:{...us(f),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:n.wrap(m,!0)},{type:"text",value:` -`}]}}const ms=(function(n){if(n==null)return _E;if(typeof n=="function")return ps(n);if(typeof n=="object")return Array.isArray(n)?jE(n):CE(n);if(typeof n=="string")return TE(n);throw new Error("Expected function, string, or object as test")});function jE(n){const r=[];let a=-1;for(;++a":""))+")"})}return L;function L(){const D=!d||x(w,v,S[S.length-1]||void 0);let $=qb;if(m&&D&&($=xy(m(w,S,v)),$[0]===ns))return $;if("children"in w&&w.children){const I=w;if(I.children&&$[0]!==Dd){let J=(s?-1:I.children.length)+y;const ie=[...S,I];for(;J>-1&&J":""))+")"})}return L;function L(){const D=!d||x(w,v,S[S.length-1]||void 0);let $=Fb;if(m&&D&&($=xy(m(w,S,v)),$[0]===ns))return $;if("children"in w&&w.children){const I=w;if(I.children&&$[0]!==Dd){let J=(s?-1:I.children.length)+y;const ie=[...S,I];for(;J>-1&&J0&&a.push({type:"text",value:` -`}),a}function yy(n){let r=0,a=n.charCodeAt(r);for(;a===9||a===32;)r++,a=n.charCodeAt(r);return n.slice(r)}function by(n,r){const a=OE(n,r),u=a.one(n,void 0),s=EE(a),d=Array.isArray(u)?{type:"root",children:u}:u||{type:"root",children:[]};return s&&d.children.push({type:"text",value:` -`},s),d}function HE(n,r){return n&&"run"in n?async function(a,u){const s=by(a,{file:u,...r});await n.run(s,u)}:function(a,u){return by(a,{file:u,...n||r})}}function vy(n){if(n)throw n}var ad,wy;function qE(){if(wy)return ad;wy=1;var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,s=function(x){return typeof Array.isArray=="function"?Array.isArray(x):r.call(x)==="[object Array]"},d=function(x){if(!x||r.call(x)!=="[object Object]")return!1;var y=n.call(x,"constructor"),g=x.constructor&&x.constructor.prototype&&n.call(x.constructor.prototype,"isPrototypeOf");if(x.constructor&&!y&&!g)return!1;var w;for(w in x);return typeof w>"u"||n.call(x,w)},f=function(x,y){a&&y.name==="__proto__"?a(x,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):x[y.name]=y.newValue},m=function(x,y){if(y==="__proto__")if(n.call(x,y)){if(u)return u(x,y).value}else return;return x[y]};return ad=function p(){var x,y,g,w,v,S,T=arguments[0],L=1,D=arguments.length,$=!1;for(typeof T=="boolean"&&($=T,T=arguments[1]||{},L=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});Lf.length;let p;m&&f.push(s);try{p=n.apply(this,f)}catch(x){const y=x;if(m&&a)throw y;return s(y)}m||(p&&p.then&&typeof p.then=="function"?p.then(d,s):p instanceof Error?s(p):d(p))}function s(f,...m){a||(a=!0,r(f,...m))}function d(f){s(null,f)}}const yl={basename:GE,dirname:QE,extname:XE,join:IE,sep:"/"};function GE(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');cu(n);let a=0,u=-1,s=n.length,d;if(r===void 0||r.length===0||r.length>n.length){for(;s--;)if(n.codePointAt(s)===47){if(d){a=s+1;break}}else u<0&&(d=!0,u=s+1);return u<0?"":n.slice(a,u)}if(r===n)return"";let f=-1,m=r.length-1;for(;s--;)if(n.codePointAt(s)===47){if(d){a=s+1;break}}else f<0&&(d=!0,f=s+1),m>-1&&(n.codePointAt(s)===r.codePointAt(m--)?m<0&&(u=s):(m=-1,u=f));return a===u?u=f:u<0&&(u=n.length),n.slice(a,u)}function QE(n){if(cu(n),n.length===0)return".";let r=-1,a=n.length,u;for(;--a;)if(n.codePointAt(a)===47){if(u){r=a;break}}else u||(u=!0);return r<0?n.codePointAt(0)===47?"/":".":r===1&&n.codePointAt(0)===47?"//":n.slice(0,r)}function XE(n){cu(n);let r=n.length,a=-1,u=0,s=-1,d=0,f;for(;r--;){const m=n.codePointAt(r);if(m===47){if(f){u=r+1;break}continue}a<0&&(f=!0,a=r+1),m===46?s<0?s=r:d!==1&&(d=1):s>-1&&(d=-1)}return s<0||a<0||d===0||d===1&&s===a-1&&s===u+1?"":n.slice(s,a)}function IE(...n){let r=-1,a;for(;++r0&&n.codePointAt(n.length-1)===47&&(a+="/"),r?"/"+a:a}function ZE(n,r){let a="",u=0,s=-1,d=0,f=-1,m,p;for(;++f<=n.length;){if(f2){if(p=a.lastIndexOf("/"),p!==a.length-1){p<0?(a="",u=0):(a=a.slice(0,p),u=a.length-1-a.lastIndexOf("/")),s=f,d=0;continue}}else if(a.length>0){a="",u=0,s=f,d=0;continue}}r&&(a=a.length>0?a+"/..":"..",u=2)}else a.length>0?a+="/"+n.slice(s+1,f):a=n.slice(s+1,f),u=f-s-1;s=f,d=0}else m===46&&d>-1?d++:d=-1}return a}function cu(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const $E={cwd:JE};function JE(){return"/"}function Ud(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function PE(n){if(typeof n=="string")n=new URL(n);else if(!Ud(n)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(n.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return WE(n)}function WE(n){if(n.hostname!==""){const u=new TypeError('File URL host must be "localhost" or empty on darwin');throw u.code="ERR_INVALID_FILE_URL_HOST",u}const r=n.pathname;let a=-1;for(;++a0){let[v,...S]=y;const T=u[w][1];Ld(T)&&Ld(v)&&(v=ud(!0,T,v)),u[w]=[x,v,...S]}}}}const lj=new rh().freeze();function fd(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function dd(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function hd(n,r){if(r)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Sy(n){if(!Ld(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function Ny(n,r,a){if(!a)throw new Error("`"+n+"` finished async. Use `"+r+"` instead")}function Io(n){return ij(n)?n:new Fb(n)}function ij(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function rj(n){return typeof n=="string"||aj(n)}function aj(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const uj="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ey=[],jy={allowDangerousHtml:!0},oj=/^(https?|ircs?|mailto|xmpp)$/i,sj=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function cj(n){const r=fj(n),a=dj(n);return hj(r.runSync(r.parse(a),a),n)}function fj(n){const r=n.rehypePlugins||Ey,a=n.remarkPlugins||Ey,u=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...jy}:jy;return lj().use(G3).use(a).use(HE,u).use(r)}function dj(n){const r=n.children||"",a=new Fb;return typeof r=="string"&&(a.value=r),a}function hj(n,r){const a=r.allowedElements,u=r.allowElement,s=r.components,d=r.disallowedElements,f=r.skipHtml,m=r.unwrapDisallowed,p=r.urlTransform||mj;for(const y of sj)Object.hasOwn(r,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+uj+y.id,void 0);return ih(n,x),AS(n,{Fragment:h.Fragment,components:s,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function x(y,g,w){if(y.type==="raw"&&w&&typeof g=="number")return f?w.children.splice(g,1):w.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let v;for(v in ld)if(Object.hasOwn(ld,v)&&Object.hasOwn(y.properties,v)){const S=y.properties[v],T=ld[v];(T===null||T.includes(y.tagName))&&(y.properties[v]=p(String(S||""),v,y))}}if(y.type==="element"){let v=a?!a.includes(y.tagName):d?d.includes(y.tagName):!1;if(!v&&u&&typeof g=="number"&&(v=!u(y,g,w)),v&&w&&typeof g=="number")return m&&y.children?w.children.splice(g,1,...y.children):w.children.splice(g,1),g}}}function mj(n){const r=n.indexOf(":"),a=n.indexOf("?"),u=n.indexOf("#"),s=n.indexOf("/");return r===-1||s!==-1&&r>s||a!==-1&&r>a||u!==-1&&r>u||oj.test(n.slice(0,r))?n:""}function pj(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Vb(n,r,a){const s=ms((a||{}).ignore||[]),d=gj(r);let f=-1;for(;++f0?{type:"text",value:U}:void 0),U===!1)v.lastIndex=J+1;else{if(T!==J&&I({type:"text",value:x.value.slice(T,J)}),Array.isArray(U))for(const R of U)I(R);else U&&I(U);T=J+$[0].length,L=!0}if(!v.global)break;$=v.exec(x.value)}return L?(T?\]}]+$/.exec(n);if(!r)return[n,void 0];n=n.slice(0,r.index);let a=r[0],u=a.indexOf(")");const s=Cy(n,"(");let d=Cy(n,")");for(;u!==-1&&s>d;)n+=a.slice(0,u+1),a=a.slice(u+1),u=a.indexOf(")"),d++;return[n,a]}function Yb(n,r){const a=n.input.charCodeAt(n.index-1);return(n.index===0||tr(a)||fs(a))&&(!r||a!==47)}Gb.peek=Vj;function Oj(){this.buffer()}function Rj(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function Lj(){this.buffer()}function Uj(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function Bj(n){const r=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=tl(this.sliceSerialize(n)).toLowerCase(),a.label=r}function Hj(n){this.exit(n)}function qj(n){const r=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=tl(this.sliceSerialize(n)).toLowerCase(),a.label=r}function Fj(n){this.exit(n)}function Vj(){return"["}function Gb(n,r,a,u){const s=a.createTracker(u);let d=s.move("[^");const f=a.enter("footnoteReference"),m=a.enter("reference");return d+=s.move(a.safe(a.associationId(n),{after:"]",before:d})),m(),f(),d+=s.move("]"),d}function Yj(){return{enter:{gfmFootnoteCallString:Oj,gfmFootnoteCall:Rj,gfmFootnoteDefinitionLabelString:Lj,gfmFootnoteDefinition:Uj},exit:{gfmFootnoteCallString:Bj,gfmFootnoteCall:Hj,gfmFootnoteDefinitionLabelString:qj,gfmFootnoteDefinition:Fj}}}function Gj(n){let r=!1;return n&&n.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:a,footnoteReference:Gb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(u,s,d,f){const m=d.createTracker(f);let p=m.move("[^");const x=d.enter("footnoteDefinition"),y=d.enter("label");return p+=m.move(d.safe(d.associationId(u),{before:p,after:"]"})),y(),p+=m.move("]:"),u.children&&u.children.length>0&&(m.shift(4),p+=m.move((r?` -`:" ")+d.indentLines(d.containerFlow(u,m.current()),r?Qb:Qj))),x(),p}}function Qj(n,r,a){return r===0?n:Qb(n,r,a)}function Qb(n,r,a){return(a?"":" ")+n}const Xj=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ah.attention=Jj;ah.peek=Pj;function Ij(){return{canContainEols:["delete"],enter:{strikethrough:Zj},exit:{strikethrough:$j}}}function Kj(){return{handlers:{delete:ah},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Xj}]}}function Zj(n){this.enter({type:"delete",children:[],position:void 0},n)}function $j(n){this.exit(n)}function ah(n,r,a,u){const s=a.createTracker(u),d=a.stack.includes("strikethrough")?"~":"~~",f=a.enter("strikethrough");let m=s.move(d);return m+=a.containerPhrasing(n,{...s.current(),before:m,after:"~"}),m+=s.move(d),f(),m}function Jj(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function Pj(){return"~"}function Wj(n){return n.length}function e5(n,r){const a=r||{},u=(a.align||[]).concat(),s=a.stringLength||Wj,d=[],f=[],m=[],p=[];let x=0,y=-1;for(;++yx&&(x=n[y].length);++Dp[D])&&(p[D]=I)}T.push($)}f[y]=T,m[y]=L}let g=-1;if(typeof u=="object"&&"length"in u)for(;++gp[g]&&(p[g]=$),v[g]=$),w[g]=I}f.splice(1,0,w),m.splice(1,0,v),y=-1;const S=[];for(;++y "),d.shift(2);const f=a.indentLines(a.containerFlow(n,d.current()),i5);return s(),f}function i5(n,r,a){return">"+(a?"":" ")+n}function r5(n,r){return _y(n,r.inConstruct,!0)&&!_y(n,r.notInConstruct,!1)}function _y(n,r,a){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return a;let u=-1;for(;++uf&&(f=d):d=1,s=u+r.length,u=a.indexOf(r,s);return f}function u5(n,r){return!!(r.options.fences===!1&&n.value&&!n.lang&&/[^\n\r ]/.test(n.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(n.value))}function o5(n){const r=n.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function s5(n,r,a,u){const s=o5(a),d=n.value||"";if(u5(n,a)){const g=a.enter("codeIndented"),w=a.indentLines(d,c5);return g(),w}const f=a.createTracker(u),m=s.repeat(Math.max(a5(d,s)+1,3)),p=a.enter("codeFenced"),x=s==="`"?"GraveAccent":"Tilde";let y=f.move(m);if(n.lang){const g=a.enter(`codeFencedLang${x}`);y+=f.move(a.safe(n.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(n.lang&&n.meta){const g=a.enter(`codeFencedMeta${x}`);y+=f.move(" "),y+=f.move(a.safe(n.meta,{before:y,after:` +`}),a}function yy(n){let r=0,a=n.charCodeAt(r);for(;a===9||a===32;)r++,a=n.charCodeAt(r);return n.slice(r)}function by(n,r){const a=RE(n,r),u=a.one(n,void 0),s=jE(a),d=Array.isArray(u)?{type:"root",children:u}:u||{type:"root",children:[]};return s&&d.children.push({type:"text",value:` +`},s),d}function qE(n,r){return n&&"run"in n?async function(a,u){const s=by(a,{file:u,...r});await n.run(s,u)}:function(a,u){return by(a,{file:u,...n||r})}}function vy(n){if(n)throw n}var ad,wy;function FE(){if(wy)return ad;wy=1;var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,s=function(x){return typeof Array.isArray=="function"?Array.isArray(x):r.call(x)==="[object Array]"},d=function(x){if(!x||r.call(x)!=="[object Object]")return!1;var y=n.call(x,"constructor"),g=x.constructor&&x.constructor.prototype&&n.call(x.constructor.prototype,"isPrototypeOf");if(x.constructor&&!y&&!g)return!1;var w;for(w in x);return typeof w>"u"||n.call(x,w)},f=function(x,y){a&&y.name==="__proto__"?a(x,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):x[y.name]=y.newValue},m=function(x,y){if(y==="__proto__")if(n.call(x,y)){if(u)return u(x,y).value}else return;return x[y]};return ad=function p(){var x,y,g,w,v,S,T=arguments[0],L=1,D=arguments.length,$=!1;for(typeof T=="boolean"&&($=T,T=arguments[1]||{},L=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});Lf.length;let p;m&&f.push(s);try{p=n.apply(this,f)}catch(x){const y=x;if(m&&a)throw y;return s(y)}m||(p&&p.then&&typeof p.then=="function"?p.then(d,s):p instanceof Error?s(p):d(p))}function s(f,...m){a||(a=!0,r(f,...m))}function d(f){s(null,f)}}const yl={basename:QE,dirname:XE,extname:IE,join:KE,sep:"/"};function QE(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');cu(n);let a=0,u=-1,s=n.length,d;if(r===void 0||r.length===0||r.length>n.length){for(;s--;)if(n.codePointAt(s)===47){if(d){a=s+1;break}}else u<0&&(d=!0,u=s+1);return u<0?"":n.slice(a,u)}if(r===n)return"";let f=-1,m=r.length-1;for(;s--;)if(n.codePointAt(s)===47){if(d){a=s+1;break}}else f<0&&(d=!0,f=s+1),m>-1&&(n.codePointAt(s)===r.codePointAt(m--)?m<0&&(u=s):(m=-1,u=f));return a===u?u=f:u<0&&(u=n.length),n.slice(a,u)}function XE(n){if(cu(n),n.length===0)return".";let r=-1,a=n.length,u;for(;--a;)if(n.codePointAt(a)===47){if(u){r=a;break}}else u||(u=!0);return r<0?n.codePointAt(0)===47?"/":".":r===1&&n.codePointAt(0)===47?"//":n.slice(0,r)}function IE(n){cu(n);let r=n.length,a=-1,u=0,s=-1,d=0,f;for(;r--;){const m=n.codePointAt(r);if(m===47){if(f){u=r+1;break}continue}a<0&&(f=!0,a=r+1),m===46?s<0?s=r:d!==1&&(d=1):s>-1&&(d=-1)}return s<0||a<0||d===0||d===1&&s===a-1&&s===u+1?"":n.slice(s,a)}function KE(...n){let r=-1,a;for(;++r0&&n.codePointAt(n.length-1)===47&&(a+="/"),r?"/"+a:a}function $E(n,r){let a="",u=0,s=-1,d=0,f=-1,m,p;for(;++f<=n.length;){if(f2){if(p=a.lastIndexOf("/"),p!==a.length-1){p<0?(a="",u=0):(a=a.slice(0,p),u=a.length-1-a.lastIndexOf("/")),s=f,d=0;continue}}else if(a.length>0){a="",u=0,s=f,d=0;continue}}r&&(a=a.length>0?a+"/..":"..",u=2)}else a.length>0?a+="/"+n.slice(s+1,f):a=n.slice(s+1,f),u=f-s-1;s=f,d=0}else m===46&&d>-1?d++:d=-1}return a}function cu(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const JE={cwd:PE};function PE(){return"/"}function Ud(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function WE(n){if(typeof n=="string")n=new URL(n);else if(!Ud(n)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(n.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return ej(n)}function ej(n){if(n.hostname!==""){const u=new TypeError('File URL host must be "localhost" or empty on darwin');throw u.code="ERR_INVALID_FILE_URL_HOST",u}const r=n.pathname;let a=-1;for(;++a0){let[v,...S]=y;const T=u[w][1];Ld(T)&&Ld(v)&&(v=ud(!0,T,v)),u[w]=[x,v,...S]}}}}const ij=new rh().freeze();function fd(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function dd(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function hd(n,r){if(r)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Sy(n){if(!Ld(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function Ny(n,r,a){if(!a)throw new Error("`"+n+"` finished async. Use `"+r+"` instead")}function Io(n){return rj(n)?n:new Vb(n)}function rj(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function aj(n){return typeof n=="string"||uj(n)}function uj(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const oj="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ey=[],jy={allowDangerousHtml:!0},sj=/^(https?|ircs?|mailto|xmpp)$/i,cj=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function fj(n){const r=dj(n),a=hj(n);return mj(r.runSync(r.parse(a),a),n)}function dj(n){const r=n.rehypePlugins||Ey,a=n.remarkPlugins||Ey,u=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...jy}:jy;return ij().use(Q3).use(a).use(qE,u).use(r)}function hj(n){const r=n.children||"",a=new Vb;return typeof r=="string"&&(a.value=r),a}function mj(n,r){const a=r.allowedElements,u=r.allowElement,s=r.components,d=r.disallowedElements,f=r.skipHtml,m=r.unwrapDisallowed,p=r.urlTransform||pj;for(const y of cj)Object.hasOwn(r,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+oj+y.id,void 0);return ih(n,x),zS(n,{Fragment:h.Fragment,components:s,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function x(y,g,w){if(y.type==="raw"&&w&&typeof g=="number")return f?w.children.splice(g,1):w.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let v;for(v in ld)if(Object.hasOwn(ld,v)&&Object.hasOwn(y.properties,v)){const S=y.properties[v],T=ld[v];(T===null||T.includes(y.tagName))&&(y.properties[v]=p(String(S||""),v,y))}}if(y.type==="element"){let v=a?!a.includes(y.tagName):d?d.includes(y.tagName):!1;if(!v&&u&&typeof g=="number"&&(v=!u(y,g,w)),v&&w&&typeof g=="number")return m&&y.children?w.children.splice(g,1,...y.children):w.children.splice(g,1),g}}}function pj(n){const r=n.indexOf(":"),a=n.indexOf("?"),u=n.indexOf("#"),s=n.indexOf("/");return r===-1||s!==-1&&r>s||a!==-1&&r>a||u!==-1&&r>u||sj.test(n.slice(0,r))?n:""}function gj(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Yb(n,r,a){const s=ms((a||{}).ignore||[]),d=xj(r);let f=-1;for(;++f0?{type:"text",value:U}:void 0),U===!1)v.lastIndex=J+1;else{if(T!==J&&I({type:"text",value:x.value.slice(T,J)}),Array.isArray(U))for(const R of U)I(R);else U&&I(U);T=J+$[0].length,L=!0}if(!v.global)break;$=v.exec(x.value)}return L?(T?\]}]+$/.exec(n);if(!r)return[n,void 0];n=n.slice(0,r.index);let a=r[0],u=a.indexOf(")");const s=Cy(n,"(");let d=Cy(n,")");for(;u!==-1&&s>d;)n+=a.slice(0,u+1),a=a.slice(u+1),u=a.indexOf(")"),d++;return[n,a]}function Gb(n,r){const a=n.input.charCodeAt(n.index-1);return(n.index===0||tr(a)||fs(a))&&(!r||a!==47)}Qb.peek=Yj;function Rj(){this.buffer()}function Lj(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function Uj(){this.buffer()}function Bj(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function Hj(n){const r=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=tl(this.sliceSerialize(n)).toLowerCase(),a.label=r}function qj(n){this.exit(n)}function Fj(n){const r=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=tl(this.sliceSerialize(n)).toLowerCase(),a.label=r}function Vj(n){this.exit(n)}function Yj(){return"["}function Qb(n,r,a,u){const s=a.createTracker(u);let d=s.move("[^");const f=a.enter("footnoteReference"),m=a.enter("reference");return d+=s.move(a.safe(a.associationId(n),{after:"]",before:d})),m(),f(),d+=s.move("]"),d}function Gj(){return{enter:{gfmFootnoteCallString:Rj,gfmFootnoteCall:Lj,gfmFootnoteDefinitionLabelString:Uj,gfmFootnoteDefinition:Bj},exit:{gfmFootnoteCallString:Hj,gfmFootnoteCall:qj,gfmFootnoteDefinitionLabelString:Fj,gfmFootnoteDefinition:Vj}}}function Qj(n){let r=!1;return n&&n.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:a,footnoteReference:Qb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(u,s,d,f){const m=d.createTracker(f);let p=m.move("[^");const x=d.enter("footnoteDefinition"),y=d.enter("label");return p+=m.move(d.safe(d.associationId(u),{before:p,after:"]"})),y(),p+=m.move("]:"),u.children&&u.children.length>0&&(m.shift(4),p+=m.move((r?` +`:" ")+d.indentLines(d.containerFlow(u,m.current()),r?Xb:Xj))),x(),p}}function Xj(n,r,a){return r===0?n:Xb(n,r,a)}function Xb(n,r,a){return(a?"":" ")+n}const Ij=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ah.attention=Pj;ah.peek=Wj;function Kj(){return{canContainEols:["delete"],enter:{strikethrough:$j},exit:{strikethrough:Jj}}}function Zj(){return{handlers:{delete:ah},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Ij}]}}function $j(n){this.enter({type:"delete",children:[],position:void 0},n)}function Jj(n){this.exit(n)}function ah(n,r,a,u){const s=a.createTracker(u),d=a.stack.includes("strikethrough")?"~":"~~",f=a.enter("strikethrough");let m=s.move(d);return m+=a.containerPhrasing(n,{...s.current(),before:m,after:"~"}),m+=s.move(d),f(),m}function Pj(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function Wj(){return"~"}function e5(n){return n.length}function t5(n,r){const a=r||{},u=(a.align||[]).concat(),s=a.stringLength||e5,d=[],f=[],m=[],p=[];let x=0,y=-1;for(;++yx&&(x=n[y].length);++Dp[D])&&(p[D]=I)}T.push($)}f[y]=T,m[y]=L}let g=-1;if(typeof u=="object"&&"length"in u)for(;++gp[g]&&(p[g]=$),v[g]=$),w[g]=I}f.splice(1,0,w),m.splice(1,0,v),y=-1;const S=[];for(;++y "),d.shift(2);const f=a.indentLines(a.containerFlow(n,d.current()),r5);return s(),f}function r5(n,r,a){return">"+(a?"":" ")+n}function a5(n,r){return _y(n,r.inConstruct,!0)&&!_y(n,r.notInConstruct,!1)}function _y(n,r,a){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return a;let u=-1;for(;++uf&&(f=d):d=1,s=u+r.length,u=a.indexOf(r,s);return f}function o5(n,r){return!!(r.options.fences===!1&&n.value&&!n.lang&&/[^\n\r ]/.test(n.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(n.value))}function s5(n){const r=n.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function c5(n,r,a,u){const s=s5(a),d=n.value||"";if(o5(n,a)){const g=a.enter("codeIndented"),w=a.indentLines(d,f5);return g(),w}const f=a.createTracker(u),m=s.repeat(Math.max(u5(d,s)+1,3)),p=a.enter("codeFenced"),x=s==="`"?"GraveAccent":"Tilde";let y=f.move(m);if(n.lang){const g=a.enter(`codeFencedLang${x}`);y+=f.move(a.safe(n.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(n.lang&&n.meta){const g=a.enter(`codeFencedMeta${x}`);y+=f.move(" "),y+=f.move(a.safe(n.meta,{before:y,after:` `,encode:["`"],...f.current()})),g()}return y+=f.move(` `),d&&(y+=f.move(d+` -`)),y+=f.move(m),p(),y}function c5(n,r,a){return(a?"":" ")+n}function uh(n){const r=n.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function f5(n,r,a,u){const s=uh(a),d=s==='"'?"Quote":"Apostrophe",f=a.enter("definition");let m=a.enter("label");const p=a.createTracker(u);let x=p.move("[");return x+=p.move(a.safe(a.associationId(n),{before:x,after:"]",...p.current()})),x+=p.move("]: "),m(),!n.url||/[\0- \u007F]/.test(n.url)?(m=a.enter("destinationLiteral"),x+=p.move("<"),x+=p.move(a.safe(n.url,{before:x,after:">",...p.current()})),x+=p.move(">")):(m=a.enter("destinationRaw"),x+=p.move(a.safe(n.url,{before:x,after:n.title?" ":` -`,...p.current()}))),m(),n.title&&(m=a.enter(`title${d}`),x+=p.move(" "+s),x+=p.move(a.safe(n.title,{before:x,after:s,...p.current()})),x+=p.move(s),m()),f(),x}function d5(n){const r=n.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function os(n){const r=n.codePointAt(0);return r===void 0?"":String.fromCodePoint(r)}function Jr(n){const r=n.codePointAt(n.length-2);return r!==void 0&&r>65535?n.slice(-2):n.slice(-1)}function Xb(n){return"&#x"+n.toString(16).toUpperCase()+";"}function zy(n,r,a){const u=wi(n),s=wi(r);return u===void 0?s===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:u===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function h5(n){if(n.charCodeAt(0)!==60)return;const r=n.charCodeAt(1);if(r===33){const m=n.charCodeAt(2);return m===45?2:m===91?5:Pt(m)?4:void 0}if(r===63)return 3;const a=r===47,u=a?2:1;let s=u,d=n.charCodeAt(s);if(!Pt(d))return;for(;d===45||Wt(d);)d=n.charCodeAt(++s);const f=n.slice(u,s).toLowerCase();return!a&&d!==47&&zd.includes(f)?1:_b.includes(f)?6:7}const m5=new Map([["*",!1],["_",!0]]);function p5(n,r,a){const u=new Set;for(const d of n){const f=a.get(d);if(f&&d.attention&&r.some(m=>m.attention===d.attention))for(const m of f.tokens)u.add(m.attention)}const s=[];for(const d of n)d.attention&&u.delete(d.attention)&&s.push(d.attention);return s.reverse(),s}function Ib(n,r,a){const u=[],s=new Map,d=new Map;let f=0;for(;fa.index)return{chosen:p,mistake:y,tokens:x}}}}function x5(n,r){const a=new Map;for(const u of n){const s=u.tokens[0].value.charAt(0);let d=a.get(s);d||(d=[],a.set(s,d));let f=u.close?d.length:0;for(;f--&&u.start1&&x>1?2:1:x,g=m.markers.slice(m.end-y,m.end),w=u.markers.slice(u.start,u.start+y),v=g[0],S=w[0];if(v===g[y-1]&&v.value.length===y&&S===w[y-1]&&S.value.length===y&&v.attention===S.attention)r.delete(v),r.delete(S);else{const T=[...new Set([...g,...w])];for(const L of T){const D=r.get(L);D&&D.push(...T)}}m.end-=y,u.start+=y,m.start===m.end&&d.splice(f,1),f=d.length}u.open&&u.start0?S[0].value:"",L=zy(w.charCodeAt(w.length-1),T.charCodeAt(0),y);L.inside&&Ko(S,!0);const D=S.length>0?Jr(S[S.length-1].value):"",$=zy(v.charCodeAt(0),D.charCodeAt(D.length-1),y);$.inside&&Ko(S,!1),L.outside&&w!==` -`&&w!=="\r"&&Ko(s,!1),$.outside&&(d=v),s.push({value:x,attention:p},...S,{value:x,attention:p}),f=x.charAt(x.length-1)}return s}function gs(n,r,a){let u=new Map;const s=sh(n,u,r,a);let d=s,f=Ib(d,r,a);for(;f;){const p=g5(n,u,f,r,a);if(!p){d=s;break}u=p.chosen,d=p.tokens,f=p.mistake}let m="";for(const p of d)m+=p.value;return m}ch.attention=Kb;ch.peek=v5;function ch(n,r,a,u){const s=a.enter("phrasing"),d=oh(n,Kb,a,a.createTracker(u)),f=gs([d],u.before,u.after);return s(),f}function Kb(n,r){return{construct:"emphasis",markers:d5(r)==="*"?["*","_"]:["_","*"],sizes:[1]}}function v5(n,r,a){return a.options.emphasis||"*"}function w5(n,r){let a=!1;return ih(n,function(u){if("value"in u&&/\r?\n|\r/.test(u.value)||u.type==="break")return a=!0,ns}),!!((!n.depth||n.depth<3)&&Jd(n)&&(r.options.setext||a))}function k5(n,r,a,u){const s=Math.max(Math.min(6,n.depth||1),1),d=a.createTracker(u);if(w5(n,a)){const g=a.enter("headingSetext"),w=a.enter("phrasing"),v=a.containerPhrasing(n,{...d.current(),before:` +`)),y+=f.move(m),p(),y}function f5(n,r,a){return(a?"":" ")+n}function uh(n){const r=n.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function d5(n,r,a,u){const s=uh(a),d=s==='"'?"Quote":"Apostrophe",f=a.enter("definition");let m=a.enter("label");const p=a.createTracker(u);let x=p.move("[");return x+=p.move(a.safe(a.associationId(n),{before:x,after:"]",...p.current()})),x+=p.move("]: "),m(),!n.url||/[\0- \u007F]/.test(n.url)?(m=a.enter("destinationLiteral"),x+=p.move("<"),x+=p.move(a.safe(n.url,{before:x,after:">",...p.current()})),x+=p.move(">")):(m=a.enter("destinationRaw"),x+=p.move(a.safe(n.url,{before:x,after:n.title?" ":` +`,...p.current()}))),m(),n.title&&(m=a.enter(`title${d}`),x+=p.move(" "+s),x+=p.move(a.safe(n.title,{before:x,after:s,...p.current()})),x+=p.move(s),m()),f(),x}function h5(n){const r=n.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function os(n){const r=n.codePointAt(0);return r===void 0?"":String.fromCodePoint(r)}function Jr(n){const r=n.codePointAt(n.length-2);return r!==void 0&&r>65535?n.slice(-2):n.slice(-1)}function Ib(n){return"&#x"+n.toString(16).toUpperCase()+";"}function zy(n,r,a){const u=wi(n),s=wi(r);return u===void 0?s===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:u===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function m5(n){if(n.charCodeAt(0)!==60)return;const r=n.charCodeAt(1);if(r===33){const m=n.charCodeAt(2);return m===45?2:m===91?5:Pt(m)?4:void 0}if(r===63)return 3;const a=r===47,u=a?2:1;let s=u,d=n.charCodeAt(s);if(!Pt(d))return;for(;d===45||Wt(d);)d=n.charCodeAt(++s);const f=n.slice(u,s).toLowerCase();return!a&&d!==47&&zd.includes(f)?1:Ab.includes(f)?6:7}const p5=new Map([["*",!1],["_",!0]]);function g5(n,r,a){const u=new Set;for(const d of n){const f=a.get(d);if(f&&d.attention&&r.some(m=>m.attention===d.attention))for(const m of f.tokens)u.add(m.attention)}const s=[];for(const d of n)d.attention&&u.delete(d.attention)&&s.push(d.attention);return s.reverse(),s}function Kb(n,r,a){const u=[],s=new Map,d=new Map;let f=0;for(;fa.index)return{chosen:p,mistake:y,tokens:x}}}}function y5(n,r){const a=new Map;for(const u of n){const s=u.tokens[0].value.charAt(0);let d=a.get(s);d||(d=[],a.set(s,d));let f=u.close?d.length:0;for(;f--&&u.start1&&x>1?2:1:x,g=m.markers.slice(m.end-y,m.end),w=u.markers.slice(u.start,u.start+y),v=g[0],S=w[0];if(v===g[y-1]&&v.value.length===y&&S===w[y-1]&&S.value.length===y&&v.attention===S.attention)r.delete(v),r.delete(S);else{const T=[...new Set([...g,...w])];for(const L of T){const D=r.get(L);D&&D.push(...T)}}m.end-=y,u.start+=y,m.start===m.end&&d.splice(f,1),f=d.length}u.open&&u.start0?S[0].value:"",L=zy(w.charCodeAt(w.length-1),T.charCodeAt(0),y);L.inside&&Ko(S,!0);const D=S.length>0?Jr(S[S.length-1].value):"",$=zy(v.charCodeAt(0),D.charCodeAt(D.length-1),y);$.inside&&Ko(S,!1),L.outside&&w!==` +`&&w!=="\r"&&Ko(s,!1),$.outside&&(d=v),s.push({value:x,attention:p},...S,{value:x,attention:p}),f=x.charAt(x.length-1)}return s}function gs(n,r,a){let u=new Map;const s=sh(n,u,r,a);let d=s,f=Kb(d,r,a);for(;f;){const p=x5(n,u,f,r,a);if(!p){d=s;break}u=p.chosen,d=p.tokens,f=p.mistake}let m="";for(const p of d)m+=p.value;return m}ch.attention=Zb;ch.peek=w5;function ch(n,r,a,u){const s=a.enter("phrasing"),d=oh(n,Zb,a,a.createTracker(u)),f=gs([d],u.before,u.after);return s(),f}function Zb(n,r){return{construct:"emphasis",markers:h5(r)==="*"?["*","_"]:["_","*"],sizes:[1]}}function w5(n,r,a){return a.options.emphasis||"*"}function k5(n,r){let a=!1;return ih(n,function(u){if("value"in u&&/\r?\n|\r/.test(u.value)||u.type==="break")return a=!0,ns}),!!((!n.depth||n.depth<3)&&Jd(n)&&(r.options.setext||a))}function S5(n,r,a,u){const s=Math.max(Math.min(6,n.depth||1),1),d=a.createTracker(u);if(k5(n,a)){const g=a.enter("headingSetext"),w=a.enter("phrasing"),v=a.containerPhrasing(n,{...d.current(),before:` `,after:` `});return w(),g(),v+` `+(s===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(` `))+1))}const f="#".repeat(s),m=a.enter("headingAtx"),p=a.enter("phrasing");d.move(f+" ");let x=a.containerPhrasing(n,{before:"# ",after:` -`,...d.current()});const y=x.charCodeAt(0);return(y===9||y===32)&&(x=Xb(y)+x.slice(1)),x=x?f+" "+x:f,a.options.closeAtx&&(x+=" "+f),p(),m(),x}Zb.peek=S5;function Zb(n){return n.value||""}function S5(){return"<"}$b.peek=N5;function $b(n,r,a,u){const s=uh(a),d=s==='"'?"Quote":"Apostrophe",f=a.enter("image");let m=a.enter("label");const p=a.createTracker(u);let x=p.move("![");return x+=p.move(a.safe(n.alt,{before:x,after:"]",...p.current()})),x+=p.move("]("),m(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(m=a.enter("destinationLiteral"),x+=p.move("<"),x+=p.move(a.safe(n.url,{before:x,after:">",...p.current()})),x+=p.move(">")):(m=a.enter("destinationRaw"),x+=p.move(a.safe(n.url,{before:x,after:n.title?" ":")",...p.current()}))),m(),n.title&&(m=a.enter(`title${d}`),x+=p.move(" "+s),x+=p.move(a.safe(n.title,{before:x,after:s,...p.current()})),x+=p.move(s),m()),x+=p.move(")"),f(),x}function N5(){return"!"}Jb.peek=E5;function Jb(n,r,a,u){const s=n.referenceType,d=a.enter("imageReference");let f=a.enter("label");const m=a.createTracker(u);let p=m.move("![");const x=a.safe(n.alt,{before:p,after:"]",...m.current()});p+=m.move(x+"]["),f();const y=a.stack;a.stack=y.filter(function(w){return w!=="phrasing"}),f=a.enter("reference");const g=a.safe(a.associationId(n),{before:p,after:"]",...m.current()});return f(),a.stack=y,d(),s==="full"||!x||x!==g?p+=m.move(g+"]"):s==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function E5(){return"!"}Pb.peek=j5;function Pb(n,r,a){let u=n.value||"",s="`",d=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(u);)s+="`";for(/[^\n\r ]/.test(u)&&(/^[\n\r ]/.test(u)&&/[\n\r ]$/.test(u)||/^`|`$/.test(u))&&(u=" "+u+" ");++d\u007F]/.test(n.url))}e0.peek=C5;function e0(n,r,a,u){const s=uh(a),d=s==='"'?"Quote":"Apostrophe",f=a.createTracker(u);if(Wb(n,a)){const S=a.stack;a.stack=S.filter(function(D){return D!=="phrasing"});const T=a.enter("autolink");let L=f.move("<");return L+=f.move(a.containerPhrasing(n,{before:L,after:">",...f.current()})),L+=f.move(">"),T(),a.stack=S,L}const m=a.enter("link");let p=a.enter("label"),x=f.move("[");const y=a.containerPhrasing(n,{before:x,after:"](",...f.current()});x+=f.move(y),p(),x+=f.move("](");const g=/[\0- \u007F]/.test(n.url),w=u.before.charAt(u.before.length-1);let v=n.title||void 0;if(!v&&!g&&(w===` -`||w==="\r")){let S=0;for(;S",...f.current()})),x+=f.move(">")):(p=a.enter("destinationRaw"),x+=f.move(a.safe(n.url,{before:x,after:typeof v=="string"?" ":")",...f.current()}))),p(),typeof v=="string"&&(p=a.enter(`title${d}`),x+=f.move(" "+s),x+=f.move(a.safe(v,{before:x,after:s,...f.current()})),x+=f.move(s),p()),x+=f.move(")"),m(),x}function C5(n,r,a){return Wb(n,a)?"<":"["}t0.peek=T5;function t0(n,r,a,u){const s=n.referenceType,d=a.enter("linkReference");let f=a.enter("label");const m=a.createTracker(u);let p=m.move("[");const x=a.containerPhrasing(n,{before:p,after:"]",...m.current()});p+=m.move(x+"]["),f();const y=a.stack;a.stack=y.filter(function(w){return w!=="phrasing"}),f=a.enter("reference");const g=a.safe(a.associationId(n),{before:p,after:"]",...m.current()});return f(),a.stack=y,d(),s==="full"||!x||x!==g?p+=m.move(g+"]"):s==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function T5(){return"["}function fh(n){const r=n.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function _5(n){const r=fh(n),a=n.options.bulletOther;if(!a)return r==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+a+"`) to be different");return a}function A5(n){const r=n.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function n0(n){const r=n.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function z5(n,r,a,u){const s=a.enter("list"),d=a.bulletCurrent;let f=n.ordered?A5(a):fh(a);const m=n.ordered?f==="."?")":".":_5(a);let p=r&&a.bulletLastUsed?f===a.bulletLastUsed:!1;if(!n.ordered){const y=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&y&&(!y.children||!y.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(p=!0),n0(a)===f&&y){let g=-1;for(;++g-1?r.start:1)+(a.options.incrementListMarker===!1?0:r.children.indexOf(n))+d);let f=d.length+1;(s==="tab"||s==="mixed"&&(r&&r.type==="list"&&r.spread||n.spread))&&(f=Math.ceil(f/4)*4);const m=a.createTracker(u);m.move(d+" ".repeat(f-d.length)),m.shift(f);const p=a.enter("listItem"),x=a.indentLines(a.containerFlow(n,m.current()),y);return p(),x;function y(g,w,v){return w?(v?"":" ".repeat(f))+g:(v?d:d+" ".repeat(f-d.length))+g}}function O5(n,r,a,u){const s=a.enter("paragraph"),d=a.enter("phrasing"),f=a.containerPhrasing(n,u);return d(),s(),f}function R5(n,r,a,u){if(!n.children.some(function(m){return n5(m)}))return a.containerFlow(n,u);const d=a.enter("phrasing"),f=a.containerPhrasing(n,u);return d(),f}function L5(n){const r=n.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}dh.attention=l0;dh.peek=U5;function dh(n,r,a,u){const s=a.enter("phrasing"),d=oh(n,l0,a,a.createTracker(u)),f=gs([d],u.before,u.after);return s(),f}function l0(n,r){return{construct:"strong",markers:L5(r)==="*"?["*","_"]:["_","*"],sizes:[2]}}function U5(n,r,a){return a.options.strong||"*"}function B5(n,r,a,u){const s=r?r.children:[],d=a.indexStack[a.indexStack.length-1];return a.safe(n.value,{...u,afterNode:s[d+1],beforeNode:s[d-1]})}function H5(n){const r=n.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function q5(n,r,a){const u=(n0(a)+(a.options.ruleSpaces?" ":"")).repeat(H5(a));return a.options.ruleSpaces?u.slice(0,-1):u}const i0={blockquote:l5,break:Ay,code:s5,definition:f5,emphasis:ch,hardBreak:Ay,heading:k5,html:Zb,image:$b,imageReference:Jb,inlineCode:Pb,link:e0,linkReference:t0,list:z5,listItem:M5,paragraph:O5,root:R5,strong:dh,text:B5,thematicBreak:q5};function F5(){return{enter:{table:V5,tableData:Dy,tableHeader:Dy,tableRow:G5},exit:{codeText:Q5,table:Y5,tableData:xd,tableHeader:xd,tableRow:xd}}}function V5(n){const r=n._align;this.enter({type:"table",align:r.map(function(a){return a==="none"?null:a}),children:[]},n),this.data.inTable=!0}function Y5(n){this.exit(n),this.data.inTable=void 0}function G5(n){this.enter({type:"tableRow",children:[]},n)}function xd(n){this.exit(n)}function Dy(n){this.enter({type:"tableCell",children:[]},n)}function Q5(n){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,X5));const a=this.stack[this.stack.length-1];a.type,a.value=r,this.exit(n)}function X5(n,r){return r==="|"?r:n}function I5(n){const r=n||{},a=r.tableCellPadding,u=r.tablePipeAlign,s=r.stringLength,d=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,...d.current()});const y=x.charCodeAt(0);return(y===9||y===32)&&(x=Ib(y)+x.slice(1)),x=x?f+" "+x:f,a.options.closeAtx&&(x+=" "+f),p(),m(),x}$b.peek=N5;function $b(n){return n.value||""}function N5(){return"<"}Jb.peek=E5;function Jb(n,r,a,u){const s=uh(a),d=s==='"'?"Quote":"Apostrophe",f=a.enter("image");let m=a.enter("label");const p=a.createTracker(u);let x=p.move("![");return x+=p.move(a.safe(n.alt,{before:x,after:"]",...p.current()})),x+=p.move("]("),m(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(m=a.enter("destinationLiteral"),x+=p.move("<"),x+=p.move(a.safe(n.url,{before:x,after:">",...p.current()})),x+=p.move(">")):(m=a.enter("destinationRaw"),x+=p.move(a.safe(n.url,{before:x,after:n.title?" ":")",...p.current()}))),m(),n.title&&(m=a.enter(`title${d}`),x+=p.move(" "+s),x+=p.move(a.safe(n.title,{before:x,after:s,...p.current()})),x+=p.move(s),m()),x+=p.move(")"),f(),x}function E5(){return"!"}Pb.peek=j5;function Pb(n,r,a,u){const s=n.referenceType,d=a.enter("imageReference");let f=a.enter("label");const m=a.createTracker(u);let p=m.move("![");const x=a.safe(n.alt,{before:p,after:"]",...m.current()});p+=m.move(x+"]["),f();const y=a.stack;a.stack=y.filter(function(w){return w!=="phrasing"}),f=a.enter("reference");const g=a.safe(a.associationId(n),{before:p,after:"]",...m.current()});return f(),a.stack=y,d(),s==="full"||!x||x!==g?p+=m.move(g+"]"):s==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function j5(){return"!"}Wb.peek=C5;function Wb(n,r,a){let u=n.value||"",s="`",d=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(u);)s+="`";for(/[^\n\r ]/.test(u)&&(/^[\n\r ]/.test(u)&&/[\n\r ]$/.test(u)||/^`|`$/.test(u))&&(u=" "+u+" ");++d\u007F]/.test(n.url))}t0.peek=T5;function t0(n,r,a,u){const s=uh(a),d=s==='"'?"Quote":"Apostrophe",f=a.createTracker(u);if(e0(n,a)){const S=a.stack;a.stack=S.filter(function(D){return D!=="phrasing"});const T=a.enter("autolink");let L=f.move("<");return L+=f.move(a.containerPhrasing(n,{before:L,after:">",...f.current()})),L+=f.move(">"),T(),a.stack=S,L}const m=a.enter("link");let p=a.enter("label"),x=f.move("[");const y=a.containerPhrasing(n,{before:x,after:"](",...f.current()});x+=f.move(y),p(),x+=f.move("](");const g=/[\0- \u007F]/.test(n.url),w=u.before.charAt(u.before.length-1);let v=n.title||void 0;if(!v&&!g&&(w===` +`||w==="\r")){let S=0;for(;S",...f.current()})),x+=f.move(">")):(p=a.enter("destinationRaw"),x+=f.move(a.safe(n.url,{before:x,after:typeof v=="string"?" ":")",...f.current()}))),p(),typeof v=="string"&&(p=a.enter(`title${d}`),x+=f.move(" "+s),x+=f.move(a.safe(v,{before:x,after:s,...f.current()})),x+=f.move(s),p()),x+=f.move(")"),m(),x}function T5(n,r,a){return e0(n,a)?"<":"["}n0.peek=_5;function n0(n,r,a,u){const s=n.referenceType,d=a.enter("linkReference");let f=a.enter("label");const m=a.createTracker(u);let p=m.move("[");const x=a.containerPhrasing(n,{before:p,after:"]",...m.current()});p+=m.move(x+"]["),f();const y=a.stack;a.stack=y.filter(function(w){return w!=="phrasing"}),f=a.enter("reference");const g=a.safe(a.associationId(n),{before:p,after:"]",...m.current()});return f(),a.stack=y,d(),s==="full"||!x||x!==g?p+=m.move(g+"]"):s==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function _5(){return"["}function fh(n){const r=n.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function A5(n){const r=fh(n),a=n.options.bulletOther;if(!a)return r==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+a+"`) to be different");return a}function z5(n){const r=n.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function l0(n){const r=n.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function D5(n,r,a,u){const s=a.enter("list"),d=a.bulletCurrent;let f=n.ordered?z5(a):fh(a);const m=n.ordered?f==="."?")":".":A5(a);let p=r&&a.bulletLastUsed?f===a.bulletLastUsed:!1;if(!n.ordered){const y=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&y&&(!y.children||!y.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(p=!0),l0(a)===f&&y){let g=-1;for(;++g-1?r.start:1)+(a.options.incrementListMarker===!1?0:r.children.indexOf(n))+d);let f=d.length+1;(s==="tab"||s==="mixed"&&(r&&r.type==="list"&&r.spread||n.spread))&&(f=Math.ceil(f/4)*4);const m=a.createTracker(u);m.move(d+" ".repeat(f-d.length)),m.shift(f);const p=a.enter("listItem"),x=a.indentLines(a.containerFlow(n,m.current()),y);return p(),x;function y(g,w,v){return w?(v?"":" ".repeat(f))+g:(v?d:d+" ".repeat(f-d.length))+g}}function R5(n,r,a,u){const s=a.enter("paragraph"),d=a.enter("phrasing"),f=a.containerPhrasing(n,u);return d(),s(),f}function L5(n,r,a,u){if(!n.children.some(function(m){return l5(m)}))return a.containerFlow(n,u);const d=a.enter("phrasing"),f=a.containerPhrasing(n,u);return d(),f}function U5(n){const r=n.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}dh.attention=i0;dh.peek=B5;function dh(n,r,a,u){const s=a.enter("phrasing"),d=oh(n,i0,a,a.createTracker(u)),f=gs([d],u.before,u.after);return s(),f}function i0(n,r){return{construct:"strong",markers:U5(r)==="*"?["*","_"]:["_","*"],sizes:[2]}}function B5(n,r,a){return a.options.strong||"*"}function H5(n,r,a,u){const s=r?r.children:[],d=a.indexStack[a.indexStack.length-1];return a.safe(n.value,{...u,afterNode:s[d+1],beforeNode:s[d-1]})}function q5(n){const r=n.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function F5(n,r,a){const u=(l0(a)+(a.options.ruleSpaces?" ":"")).repeat(q5(a));return a.options.ruleSpaces?u.slice(0,-1):u}const r0={blockquote:i5,break:Ay,code:c5,definition:d5,emphasis:ch,hardBreak:Ay,heading:S5,html:$b,image:Jb,imageReference:Pb,inlineCode:Wb,link:t0,linkReference:n0,list:D5,listItem:O5,paragraph:R5,root:L5,strong:dh,text:H5,thematicBreak:F5};function V5(){return{enter:{table:Y5,tableData:Dy,tableHeader:Dy,tableRow:Q5},exit:{codeText:X5,table:G5,tableData:xd,tableHeader:xd,tableRow:xd}}}function Y5(n){const r=n._align;this.enter({type:"table",align:r.map(function(a){return a==="none"?null:a}),children:[]},n),this.data.inTable=!0}function G5(n){this.exit(n),this.data.inTable=void 0}function Q5(n){this.enter({type:"tableRow",children:[]},n)}function xd(n){this.exit(n)}function Dy(n){this.enter({type:"tableCell",children:[]},n)}function X5(n){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,I5));const a=this.stack[this.stack.length-1];a.type,a.value=r,this.exit(n)}function I5(n,r){return r==="|"?r:n}function K5(n){const r=n||{},a=r.tableCellPadding,u=r.tablePipeAlign,s=r.stringLength,d=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:w,table:f,tableCell:p,tableRow:m}};function f(v,S,T,L){return x(y(v,T,L),v.align)}function m(v,S,T,L){const D=g(v,T,L),$=x([D]);return $.slice(0,$.indexOf(` -`))}function p(v,S,T,L){const D=T.enter("tableCell"),$=T.enter("phrasing"),I=T.containerPhrasing(v,{...L,before:d,after:d});return $(),D(),I}function x(v,S){return e5(v,{align:S,alignDelimiters:u,padding:a,stringLength:s})}function y(v,S,T){const L=v.children;let D=-1;const $=[],I=S.enter("table");for(;++D0&&!a&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const f4={tokenize:b4,partial:!0};function d4(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:g4,continuation:{tokenize:x4},exit:y4}},text:{91:{name:"gfmFootnoteCall",tokenize:p4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:h4,resolveTo:m4}}}}function h4(n,r,a){const u=this;let s=u.events.length;const d=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let f;for(;s--;){const p=u.events[s][1];if(p.type==="labelImage"){f=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return m;function m(p){if(!f||!f._balanced)return a(p);const x=tl(u.sliceSerialize({start:f.end,end:u.now()}));return x.codePointAt(0)!==94||!d.includes(x.slice(1))?a(p):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(p),n.exit("gfmFootnoteCallLabelMarker"),r(p))}}function m4(n,r){let a=n.length;for(;a--;)if(n[a][1].type==="labelImage"&&n[a][0]==="enter"){n[a][1];break}n[a+1][1].type="data",n[a+3][1].type="gfmFootnoteCallLabelMarker";const u={type:"gfmFootnoteCall",start:Object.assign({},n[a+3][1].start),end:Object.assign({},n[n.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},n[a+3][1].end),end:Object.assign({},n[a+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const d={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},d.start),end:Object.assign({},d.end)},m=[n[a+1],n[a+2],["enter",u,r],n[a+3],n[a+4],["enter",s,r],["exit",s,r],["enter",d,r],["enter",f,r],["exit",f,r],["exit",d,r],n[n.length-2],n[n.length-1],["exit",u,r]];return n.splice(a,n.length-a+1,...m),n}function p4(n,r,a){const u=this,s=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let d=0,f;return m;function m(g){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),p}function p(g){return g!==94?a(g):(n.enter("gfmFootnoteCallMarker"),n.consume(g),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",x)}function x(g){if(d>999||g===93&&!f||g===null||g===91||mt(g))return a(g);if(g===93){n.exit("chunkString");const w=n.exit("gfmFootnoteCallString");return s.includes(tl(u.sliceSerialize(w)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),r):a(g)}return mt(g)||(f=!0),d++,n.consume(g),g===92?y:x}function y(g){return g===91||g===92||g===93?(n.consume(g),d++,x):x(g)}}function g4(n,r,a){const u=this,s=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let d,f=0,m;return p;function p(S){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(S),n.exit("gfmFootnoteDefinitionLabelMarker"),x}function x(S){return S===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(S),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",y):a(S)}function y(S){if(f>999||S===93&&!m||S===null||S===91||mt(S))return a(S);if(S===93){n.exit("chunkString");const T=n.exit("gfmFootnoteDefinitionLabelString");return d=tl(u.sliceSerialize(T)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(S),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),w}return mt(S)||(m=!0),f++,n.consume(S),S===92?g:y}function g(S){return S===91||S===92||S===93?(n.consume(S),f++,y):y(S)}function w(S){return S===58?(n.enter("definitionMarker"),n.consume(S),n.exit("definitionMarker"),s.includes(d)||s.push(d),et(n,v,"gfmFootnoteDefinitionWhitespace")):a(S)}function v(S){return r(S)}}function x4(n,r,a){return n.check(su,r,n.attempt(f4,r,a))}function y4(n){n.exit("gfmFootnoteDefinition")}function b4(n,r,a){const u=this;return et(n,s,"gfmFootnoteDefinitionIndent",5);function s(d){const f=u.events[u.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(d):a(d)}}function v4(n){let a=(n||{}).singleTilde;const u={name:"strikethrough",tokenize:d,resolveAll:s};return a==null&&(a=!0),{text:{126:u},insideSpan:{null:[u]},attentionMarkers:{null:[126]}};function s(f,m){let p=-1;for(;++p1?p(S):(f.consume(S),g++,v);if(g<2&&!a)return p(S);const L=f.exit("strikethroughSequenceTemporary"),D=wi(S);return L._open=!D||D===2&&!!T,L._close=!T||T===2&&!!D,m(S)}}}class w4{constructor(){this.map=[],this.index=new Map}add(r,a,u){k4(this,r,a,u)}consume(r){if(this.map.sort(function(d,f){return d[0]-f[0]}),this.map.length===0)return;let a=this.map.length;const u=[];for(;a>0;)a-=1,u.push(r.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),r.length=this.map[a][0];u.push(r.slice()),r.length=0;let s=u.pop();for(;s;){for(const d of s)r.push(d);s=u.pop()}this.map.length=0,this.index.clear()}}function k4(n,r,a,u){if(a===0&&u.length===0)return;const s=n.index.get(r);if(s){s[1]+=a,s[2].push(...u);return}const d=[r,a,u];n.map.push(d),n.index.set(r,d)}function S4(n,r){let a=!1;const u=[];for(;r-1;){const{type:ve}=u.events[ne][1];if(ve==="lineEnding"||ve==="linePrefix")ne--;else break}const V=ne>-1?u.events[ne][1].type:null,se=V==="tableHead"||V==="tableRow"?U:p;return se===U&&u.parser.lazy[u.now().line]?a(B):se(B)}function p(B){return n.enter("tableHead"),n.enter("tableRow"),x(B)}function x(B){return B===124||(f=!0,d+=1),y(B)}function y(B){return B===null?a(B):Te(B)?d>1?(d=0,u.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(B),n.exit("lineEnding"),v):a(B):Ve(B)?et(n,y,"whitespace")(B):(d+=1,f&&(f=!1,s+=1),B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),f=!0,y):(n.enter("data"),g(B)))}function g(B){return B===null||B===124||mt(B)?(n.exit("data"),y(B)):(n.consume(B),B===92?w:g)}function w(B){return B===92||B===124?(n.consume(B),g):g(B)}function v(B){return u.interrupt=!1,u.parser.lazy[u.now().line]?a(B):(n.enter("tableDelimiterRow"),f=!1,Ve(B)?et(n,S,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):S(B))}function S(B){return B===45||B===58?L(B):B===124?(f=!0,n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),T):ie(B)}function T(B){return Ve(B)?et(n,L,"whitespace")(B):L(B)}function L(B){return B===58?(d+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),D):B===45?(d+=1,D(B)):B===null||Te(B)?J(B):ie(B)}function D(B){return B===45?(n.enter("tableDelimiterFiller"),$(B)):ie(B)}function $(B){return B===45?(n.consume(B),$):B===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),I):(n.exit("tableDelimiterFiller"),I(B))}function I(B){return Ve(B)?et(n,J,"whitespace")(B):J(B)}function J(B){return B===124?S(B):B===null||Te(B)?!f||s!==d?ie(B):(n.exit("tableDelimiterRow"),n.exit("tableHead"),r(B)):ie(B)}function ie(B){return a(B)}function U(B){return n.enter("tableRow"),R(B)}function R(B){return B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),R):B===null||Te(B)?(n.exit("tableRow"),r(B)):Ve(B)?et(n,R,"whitespace")(B):(n.enter("data"),Q(B))}function Q(B){return B===null||B===124||mt(B)?(n.exit("data"),R(B)):(n.consume(B),B===92?fe:Q)}function fe(B){return B===92||B===124?(n.consume(B),Q):Q(B)}}function j4(n,r){let a=-1,u=!0,s=0,d=[0,0,0,0],f=[0,0,0,0],m=!1,p=0,x,y,g;const w=new w4;for(;++aa[2]+1){const S=a[2]+1,T=a[3]-a[2]-1;n.add(S,T,[])}}n.add(a[3]+1,0,[["exit",g,r]])}return s!==void 0&&(d.end=Object.assign({},Ir(r.events,s)),n.add(s,0,[["exit",d,r]]),d=void 0),d}function Oy(n,r,a,u,s){const d=[],f=Ir(r.events,a);s&&(s.end=Object.assign({},f),d.push(["exit",s,r])),u.end=Object.assign({},f),d.push(["exit",u,r]),n.add(a+1,0,d)}function Ir(n,r){const a=n[r],u=a[0]==="enter"?"start":"end";return a[1][u]}const C4={name:"tasklistCheck",tokenize:_4};function T4(){return{text:{91:C4}}}function _4(n,r,a){const u=this;return s;function s(p){return u.previous!==null||!u._gfmTasklistFirstContentOfListItem?a(p):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(p),n.exit("taskListCheckMarker"),d)}function d(p){return mt(p)?(n.enter("taskListCheckValueUnchecked"),n.consume(p),n.exit("taskListCheckValueUnchecked"),f):p===88||p===120?(n.enter("taskListCheckValueChecked"),n.consume(p),n.exit("taskListCheckValueChecked"),f):a(p)}function f(p){return p===93?(n.enter("taskListCheckMarker"),n.consume(p),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),m):a(p)}function m(p){return Te(p)?r(p):Ve(p)?n.check({tokenize:A4},r,a)(p):a(p)}}function A4(n,r,a){return et(n,u,"whitespace");function u(s){return s===null?a(s):r(s)}}function z4(n){return yb([n4(),d4(),v4(n),N4(),T4()])}const D4={};function M4(n){const r=this,a=n||D4,u=r.data(),s=u.micromarkExtensions||(u.micromarkExtensions=[]),d=u.fromMarkdownExtensions||(u.fromMarkdownExtensions=[]),f=u.toMarkdownExtensions||(u.toMarkdownExtensions=[]);s.push(z4(a)),d.push(P5()),f.push(W5(a))}function O4(n){return n.replace(/\\n/g,` -`).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\'/g,"'").replace(/\\\\/g,"\\")}const R4={h1:({children:n})=>h.jsx("h3",{className:"mt-3 mb-1.5 text-base font-bold text-ink first:mt-0",children:n}),h2:({children:n})=>h.jsx("h4",{className:"mt-3 mb-1 text-sm font-semibold text-ink first:mt-0",children:n}),h3:({children:n})=>h.jsx("h5",{className:"mt-2 mb-1 text-xs font-semibold text-ink first:mt-0",children:n}),p:({children:n})=>h.jsx("p",{className:"my-1.5 leading-relaxed first:mt-0 last:mb-0",children:n}),strong:({children:n})=>h.jsx("strong",{className:"font-semibold text-ink",children:n}),em:({children:n})=>h.jsx("em",{className:"italic text-ink-secondary",children:n}),del:({children:n})=>h.jsx("del",{className:"text-ink-muted line-through",children:n}),a:({children:n,href:r})=>h.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-chip-indigo-text underline underline-offset-2 hover:text-ink",children:n}),code:({children:n,className:r})=>h.jsx("code",{className:`break-words rounded bg-elevated px-1 py-0.5 font-mono text-chip-indigo-text whitespace-pre-wrap ${r??""}`,children:n}),pre:({children:n})=>h.jsx("pre",{className:"my-2 overflow-x-auto rounded-lg border border-line bg-elevated p-3 font-mono text-xs text-ink [&_code]:bg-transparent [&_code]:px-0 [&_code]:py-0 [&_code]:text-inherit",children:n}),ul:({children:n})=>h.jsx("ul",{className:"my-1.5 list-disc space-y-0.5 pl-5",children:n}),ol:({children:n})=>h.jsx("ol",{className:"my-1.5 list-decimal space-y-0.5 pl-5",children:n}),li:({children:n})=>h.jsx("li",{className:"leading-relaxed",children:n}),blockquote:({children:n})=>h.jsx("blockquote",{className:"my-2 border-l-2 border-line-strong pl-3 text-ink-secondary italic",children:n}),table:({children:n})=>h.jsx("div",{className:"my-2 overflow-x-auto",children:h.jsx("table",{className:"w-full border-collapse text-xs",children:n})}),th:({children:n})=>h.jsx("th",{className:"border border-line bg-elevated px-2 py-1 text-left font-semibold",children:n}),td:({children:n})=>h.jsx("td",{className:"border border-line px-2 py-1 align-top",children:n}),hr:()=>h.jsx("hr",{className:"my-3 border-line"}),img:({alt:n,src:r,title:a})=>h.jsx("img",{src:r,alt:n,title:a,loading:"lazy",referrerPolicy:"no-referrer",className:"my-2 max-w-full rounded-lg border border-line"})};function $o({text:n}){return n?h.jsx(cj,{remarkPlugins:[M4,wj],components:R4,children:O4(n)}):null}function h0(n){return n==="completed"||n==="aborted"||n==="failed"}function tu({label:n}){return h.jsx("kbd",{"aria-hidden":"true",className:"ml-1.5 inline-block rounded border border-line/60 bg-elevated/60 px-1 py-px font-mono text-[10px] font-normal leading-none opacity-90",children:n})}function Ry(n){!n||h0(n.status)||N2(n.session_id).catch(()=>{})}const L4={running:"running",completed:"done",skipped:"skipped",failed:"failed",pending:"pending"};function Jo({text:n}){const[r,a]=_.useState(!1),u=_.useRef(void 0);_.useEffect(()=>()=>window.clearTimeout(u.current),[]);const s=async()=>{try{await navigator.clipboard.writeText(n),a(!0),window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!1),1500)}catch{}};return h.jsx("button",{type:"button",onClick:s,"aria-label":r?"Copied":"Copy content",title:r?"Copied!":"Copy content",className:"absolute right-2 top-2 rounded-md p-1.5 text-ink-muted hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:r?h.jsx(vi,{className:"h-3.5 w-3.5"}):h.jsx(An,{className:"h-3.5 w-3.5"})})}function U4({isOpen:n,onClose:r,directory:a,filename:u,release:s,args:d,onFinished:f}){var Ge,M;const[m,p]=_.useState(null),[x,y]=_.useState(!1),[g,w]=_.useState(null),[v,S]=_.useState(null),[T,L]=_.useState(!1),[D,$]=_.useState(0),I=_.useRef(null),J=_.useRef(!1),ie=_.useRef(null),U=_.useRef(!1);_.useEffect(()=>{if(!n||!a||!u){p(null),w(null),L(!1),S(null),U.current=!1;return}let E=!0;return y(!0),w(null),L(!1),S(null),k2({directory:a,filename:u,release:s,args:d}).then(Y=>{E&&(p(Y),y(!1),(Y.status==="completed"||Y.status==="aborted"||Y.status==="failed")&&(f==null||f(Y.status,Y.final_message||"")))}).catch(Y=>{E&&((Y==null?void 0:Y.status)===404&&L(!0),w(Y.message||"Failed to start workflow"),y(!1))}),()=>{E=!1}},[n,a,u,s,d,D]);const R=async E=>{if(!(!m||J.current)){J.current=!0,y(!0);try{const Y=await S2(m.session_id,E);p(Y),(Y.status==="completed"||Y.status==="aborted"||Y.status==="failed")&&(f==null||f(Y.status,Y.final_message||""))}catch(Y){(Y==null?void 0:Y.status)===404?(L(!0),w(Y.message||"Workflow session on the server has expired.")):w(Y.message||"Failed to process workflow response")}finally{J.current=!1,y(!1)}}},Q=_.useRef(m);Q.current=m;const fe=_.useRef(R);fe.current=R;const B=_.useRef(v);B.current=v;const ne=_.useRef([]),V=(E,Y)=>{var je,ye;if(E.key!=="ArrowDown"&&E.key!=="ArrowUp"&&E.key!=="Home"&&E.key!=="End")return;E.preventDefault();const oe=((je=Q.current)==null?void 0:je.steps.length)??0;if(oe===0)return;const de=E.key==="ArrowDown"?(Y+1)%oe:E.key==="ArrowUp"?(Y-1+oe)%oe:E.key==="Home"?0:oe-1;S(de),(ye=ne.current[de])==null||ye.focus()};_.useEffect(()=>()=>Ry(Q.current),[]);const se=()=>{U.current||(U.current=!0,Ry(Q.current),r())},ve=()=>{p(null),w(null),L(!1),S(null),U.current=!1,$(E=>E+1)},ae=Wr({isOpen:n,onClose:se,dialogRef:I,initialFocusRef:ie});if(_.useEffect(()=>{if(!n)return;const E=Y=>{var Se,Rt,Bt;if(Y.key==="Escape"){Y.preventDefault(),se();return}const oe=Q.current;if(!oe)return;if(h0(oe.status)){Y.key==="Enter"&&!Y.repeat&&!Y.ctrlKey&&!Y.metaKey&&!Y.altKey&&!J.current&&((Se=Y.target)==null?void 0:Se.tagName)!=="BUTTON"&&((Rt=document.activeElement)==null?void 0:Rt.tagName)!=="BUTTON"&&(Y.preventDefault(),se());return}if(J.current||Y.repeat||Y.ctrlKey||Y.metaKey||Y.altKey)return;const de=Y.target;if((de==null?void 0:de.tagName)==="INPUT"||(de==null?void 0:de.tagName)==="TEXTAREA"||de!=null&&de.isContentEditable)return;const je=B.current,ye=je===null||je===oe.current_index,_e=oe.status==="waiting_ask"?"yes":oe.status==="waiting_notify"||oe.status==="waiting_notice"?"ack":null;if(!ye||_e===null)return;if(Y.key==="Enter"){const Gt=Y.target;if((Gt==null?void 0:Gt.tagName)==="BUTTON"||((Bt=document.activeElement)==null?void 0:Bt.tagName)==="BUTTON")return;Y.preventDefault(),fe.current(_e);return}if(oe.status!=="waiting_ask")return;const pe=Y.key.toLowerCase();pe==="y"?(Y.preventDefault(),fe.current("yes")):pe==="s"?(Y.preventDefault(),fe.current("skip")):pe==="n"&&(Y.preventDefault(),fe.current("no"))};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[n,r]),_.useEffect(()=>{if(!n||!m)return;const E=requestAnimationFrame(()=>{var Y;return(Y=ie.current)==null?void 0:Y.focus()});return()=>cancelAnimationFrame(E)},[n,m==null?void 0:m.status]),!n)return null;const A=v!==null?m==null?void 0:m.steps[v]:m==null?void 0:m.steps[m.current_index],W=(m==null?void 0:m.status)==="completed"||(m==null?void 0:m.status)==="aborted"||(m==null?void 0:m.status)==="failed",le=!!m&&!W&&!T&&(((Ge=m.status)==null?void 0:Ge.startsWith("waiting"))??!1),re=(((M=m==null?void 0:m.steps[(m==null?void 0:m.current_index)??-1])==null?void 0:M.phase)??"pre")==="post",qe=!T&&(v===null||v===(m==null?void 0:m.current_index))&&(A!=null&&A.command)&&((m==null?void 0:m.status)==="waiting_notify"||(m==null?void 0:m.status)==="waiting_notice"||(m==null?void 0:m.status)==="waiting_ask")?h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Command:"}),h.jsxs("div",{className:"relative rounded-lg border border-line bg-surface-strong p-4 pr-10 font-mono text-xs text-ink leading-relaxed",children:[h.jsx(Jo,{text:A.command}),A.command]})]}):null;return h.jsx("div",{ref:I,role:"dialog","aria-modal":"true","aria-labelledby":"workflow-runner-title",onKeyDown:ae,className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-xs",children:h.jsxs("div",{className:"animate-modal-in flex h-[80vh] w-full max-w-5xl flex-col rounded-xl border border-frame-line glass-panel overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-line px-5 py-3.5 bg-surface-strong/30 shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-2.5",children:[h.jsx("span",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-chip-indigo-bg text-chip-indigo-text",children:h.jsx(eb,{className:"h-4 w-4"})}),h.jsxs("div",{children:[h.jsx("h2",{id:"workflow-runner-title",className:"text-sm font-semibold text-ink",children:"Launch Workflow Engine"}),h.jsxs("p",{className:"text-xs text-ink-muted",children:[u," ",m!=null&&m.pattern?`• Pattern: ${m.pattern}`:""]})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[m&&!W&&!T&&h.jsxs("button",{type:"button",disabled:!le||x,onClick:()=>R("bypass"),title:re?"Skip the remaining post-launch steps":"Skip the remaining steps and launch with the OS default app",className:"btn inline-flex items-center gap-1.5 rounded-md border border-line bg-surface px-3 py-1.5 text-xs font-medium text-status-warning-text hover:bg-status-warning-bg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 disabled:cursor-not-allowed disabled:opacity-40",children:[h.jsx(Fw,{className:"h-3.5 w-3.5"}),re?"Skip rest":"Launch now"]}),h.jsx("button",{type:"button",onClick:se,className:"rounded-md p-1.5 text-ink-muted hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:h.jsx(nl,{className:"h-4 w-4"})})]})]}),h.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[h.jsxs("div",{className:"w-72 border-r border-line bg-surface-strong/20 p-4 overflow-y-auto flex flex-col gap-2 shrink-0",children:[h.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-ink-muted px-1 mb-1",children:"Workflow Steps (Click to inspect)"}),m&&m.steps.length>0?h.jsx("ul",{role:"list",className:"flex flex-col gap-2",children:m.steps.map((E,Y)=>{const oe=m.current_index===Y&&!W,de=v===Y||v===null&&oe,je=L4[E.status];return h.jsx("li",{children:h.jsxs("button",{ref:ye=>{ne.current[Y]=ye},type:"button",tabIndex:de?0:-1,"aria-current":de?"step":void 0,onKeyDown:ye=>V(ye,Y),onClick:()=>S(Y),className:`flex items-start text-left gap-2.5 rounded-lg border px-3 py-2.5 transition-colors cursor-pointer w-full ${de?"border-chip-indigo-border bg-chip-indigo-bg shadow-xs ring-1 ring-chip-indigo-border/40":"border-line/60 bg-surface/60 hover:bg-elevated/80"}`,children:[h.jsxs("div",{className:"mt-0.5 shrink-0",children:[E.status==="running"&&h.jsx(Wi,{className:"h-4 w-4 animate-spin text-chip-indigo-text"}),E.status==="completed"&&h.jsx(Mx,{className:"h-4 w-4 text-status-success-text"}),E.status==="skipped"&&h.jsx(hw,{className:"h-4 w-4 text-status-warning-text"}),E.status==="failed"&&h.jsx(lu,{className:"h-4 w-4 text-status-danger-text"}),E.status==="pending"&&h.jsx("div",{className:"h-4 w-4 rounded-full border border-line-strong flex items-center justify-center text-[10px] text-ink-faint font-mono",children:E.index})]}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"font-mono text-[11px] font-bold uppercase text-chip-indigo-text",children:E.action}),h.jsxs("span",{className:"text-[10px] font-mono text-ink-faint",children:["#",E.index," · ",je]})]}),h.jsx("p",{className:"truncate font-mono text-[11px] text-ink-secondary mt-0.5",title:E.command,children:E.message?E.message.split(` -`)[0]:E.command}),E.note&&h.jsx("p",{className:"mt-1 text-[10px] text-ink-faint italic",children:E.note})]})]})},E.index)})}):h.jsx("div",{className:"p-4 text-center text-xs text-ink-faint",children:g||T?"Session unavailable — see the error panel.":"Loading steps..."})]}),h.jsxs("div",{className:"flex-1 flex flex-col bg-app",children:[h.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-6",children:h.jsx("div",{className:"space-y-6",children:h.jsxs("div",{className:"rounded-xl border border-line bg-surface p-5 shadow-xs space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"rounded bg-chip-indigo-bg px-2 py-0.5 font-mono text-xs font-semibold uppercase text-chip-indigo-text",children:(A==null?void 0:A.action)||(m==null?void 0:m.status)}),h.jsx("span",{className:"text-xs text-ink-muted",children:A?`Step ${A.index} of ${m==null?void 0:m.steps.length}`:"Status"}),v!==null&&v!==(m==null?void 0:m.current_index)&&h.jsx("button",{type:"button",onClick:()=>S(null),className:"text-[11px] text-chip-indigo-text hover:underline ml-2",children:"(Return to active step)"})]}),x&&h.jsx(Wi,{className:"h-4 w-4 animate-spin text-chip-indigo-text"})]}),h.jsxs("div",{className:"space-y-3 text-xs text-ink font-sans leading-relaxed",children:[(v===null||v===(m==null?void 0:m.current_index))&&(m==null?void 0:m.status)==="waiting_notify"&&m.notify_message&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Notification Message:"}),h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-ink",children:h.jsx($o,{text:m.notify_message})}),qe]}),(v===null||v===(m==null?void 0:m.current_index))&&(m==null?void 0:m.status)==="waiting_notice"&&m.notice_message&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Notice:"}),h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-ink",children:h.jsx($o,{text:m.notice_message})}),qe,h.jsx("p",{className:"text-[11px] text-ink-faint",children:"The command will run when you continue."})]}),(v===null||v===(m==null?void 0:m.current_index))&&(m==null?void 0:m.status)==="waiting_ask"&&m.ask_prompt&&h.jsxs("div",{className:"space-y-2",children:[m.ask_message&&h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-ink",children:h.jsx($o,{text:m.ask_message})}),h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-status-warning-text",children:"Confirmation Prompt:"}),h.jsx("div",{className:"rounded-lg border border-status-warning-border bg-status-warning-bg p-4 text-sm font-medium text-ink",children:m.ask_prompt}),qe]}),W&&v===null&&h.jsxs("div",{className:`rounded-xl border p-8 text-center space-y-4 ${(m==null?void 0:m.status)==="completed"?"border-status-success-border bg-status-success-bg text-status-success-text":"border-status-danger-border bg-status-danger-bg text-status-danger-text"}`,children:[h.jsx("div",{className:"inline-flex h-12 w-12 items-center justify-center rounded-full bg-surface/50 mx-auto",children:(m==null?void 0:m.status)==="completed"?h.jsx(Mx,{className:"h-6 w-6 text-status-success-text"}):h.jsx(lu,{className:"h-6 w-6 text-status-danger-text"})}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("h3",{className:"text-base font-bold",children:(m==null?void 0:m.status)==="completed"?"Workflow Finished":"Workflow Terminated"}),h.jsx("p",{className:"text-xs text-ink-secondary max-w-md mx-auto",children:(m==null?void 0:m.final_message)||"The launch sequence has ended."})]}),h.jsx("div",{className:"pt-2",children:h.jsx("button",{type:"button",onClick:r,className:"btn btn-primary px-8 py-2.5 font-bold shadow-lg",children:"Close Engine Runner"})})]}),W&&v===null&&(m==null?void 0:m.last_output)&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Command Output:"}),h.jsxs("div",{className:"relative",children:[h.jsx(Jo,{text:m.last_output}),h.jsx("pre",{className:"max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-line bg-surface-strong p-4 font-mono text-xs text-ink",children:m.last_output})]})]}),!T&&!(W&&v===null)&&!((v===null||v===(m==null?void 0:m.current_index))&&((m==null?void 0:m.status)==="waiting_notify"||(m==null?void 0:m.status)==="waiting_ask"||(m==null?void 0:m.status)==="waiting_notice"))&&h.jsxs("div",{className:"space-y-4",children:[(A==null?void 0:A.message)&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Message:"}),h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-xs text-ink",children:h.jsx($o,{text:A.message})})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Command:"}),h.jsx("div",{className:"relative rounded-lg border border-line bg-surface-strong p-4 font-mono text-xs text-ink leading-relaxed",children:A!=null&&A.command?h.jsxs(h.Fragment,{children:[h.jsx(Jo,{text:A.command}),h.jsx("span",{className:"block pr-8",children:A.command})]}):"Waiting..."})]}),(A==null?void 0:A.output)&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Output:"}),h.jsxs("div",{className:"relative",children:[h.jsx(Jo,{text:A.output}),h.jsx("pre",{className:"max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-line bg-surface-strong p-4 font-mono text-xs text-ink",children:A.output})]})]}),(A==null?void 0:A.ask)&&h.jsxs("div",{className:"rounded-lg border border-status-warning-border bg-status-warning-bg p-3 text-xs text-status-warning-text",children:[h.jsx("span",{className:"font-semibold",children:"Workflow Guard:"})," ",A.ask]}),(A==null?void 0:A.note)&&h.jsxs("div",{className:"rounded-lg border border-line bg-surface-strong p-3 text-xs text-ink-muted italic",children:[h.jsx("span",{className:"font-semibold text-ink-secondary not-italic uppercase text-[10px]",children:"Log:"})," ",A.note]})]})]})]})})}),(g||T)&&h.jsx("div",{className:"shrink-0 px-6 pt-3",children:h.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-status-danger-border bg-status-danger-bg p-3 text-xs text-status-danger-text",children:[h.jsx(lu,{className:"mt-0.5 h-4 w-4 shrink-0"}),h.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[h.jsx("p",{children:T?"Workflow session on the server has expired or ended.":g}),T?h.jsxs("div",{className:"space-y-2",children:[g&&h.jsxs("details",{className:"text-ink-muted",children:[h.jsx("summary",{className:"cursor-pointer select-none text-[11px] underline",children:"Raw error (for bug reports)"}),h.jsx("pre",{className:"mt-1 overflow-x-auto whitespace-pre-wrap break-words font-mono text-[11px]",children:g})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{type:"button",onClick:ve,className:"btn btn-primary px-4 py-1.5 text-xs font-semibold",children:"Restart workflow"}),h.jsx("button",{type:"button",onClick:se,className:"btn rounded-md border-line bg-surface px-4 py-1.5 text-xs",children:"Close"})]})]}):null]})]})}),h.jsxs("div",{className:"shrink-0 px-6 pt-4 pb-4 border-t border-line flex items-center justify-between bg-app",children:[h.jsx("div",{className:"text-xs text-ink-muted","aria-live":"polite",children:T?"Session unavailable — restart or close above.":(m==null?void 0:m.status)==="waiting_ask"&&(v===null||v===m.current_index)?"Action required to proceed:":(m==null?void 0:m.status)==="waiting_notify"&&(v===null||v===m.current_index)?"Acknowledge message to proceed:":(m==null?void 0:m.status)==="waiting_notice"&&(v===null||v===m.current_index)?"Continue to run the command:":W?"Session terminated.":"Step in progress..."}),h.jsxs("div",{className:"flex items-center gap-2",children:[!T&&(m==null?void 0:m.status)==="waiting_notice"&&(v===null||v===m.current_index)&&h.jsxs("button",{type:"button",ref:ie,disabled:x,onClick:()=>R("ack"),className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:["Run Command",h.jsx(tu,{label:"↵"})]}),!T&&(m==null?void 0:m.status)==="waiting_notify"&&(v===null||v===m.current_index)&&h.jsxs("button",{type:"button",ref:ie,disabled:x,onClick:()=>R("ack"),className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:["Continue Workflow",h.jsx(tu,{label:"↵"})]}),!T&&(m==null?void 0:m.status)==="waiting_ask"&&(v===null||v===m.current_index)&&h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",disabled:x,onClick:()=>R("no"),className:"btn rounded-md border-line bg-surface px-4 py-2 text-status-danger-text hover:bg-status-danger-bg",children:["Abort Launch",h.jsx(tu,{label:"N"})]}),h.jsxs("button",{type:"button",disabled:x,onClick:()=>R("skip"),className:"btn rounded-md border-line bg-surface px-4 py-2 text-status-warning-text hover:bg-status-warning-bg",children:["Skip Step",h.jsx(tu,{label:"S"})]}),h.jsxs("button",{type:"button",ref:ie,disabled:x,onClick:()=>R("yes"),className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:["Execute Step",h.jsx(tu,{label:"Y"})]})]}),W&&h.jsx("button",{type:"button",ref:ie,onClick:r,className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:"Close Runner"})]})]})]})]})]})})}function Ly({isOpen:n,title:r,message:a,confirmLabel:u="Confirm",cancelLabel:s="Cancel",danger:d=!1,onConfirm:f,onCancel:m}){const p=_.useRef(null),x=_.useRef(null),y=Wr({isOpen:n,onClose:m,dialogRef:p,initialFocusRef:x});return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",onClick:m,children:h.jsxs("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",onKeyDown:y,onClick:g=>g.stopPropagation(),className:"animate-modal-in w-[400px] max-w-full rounded-2xl border border-frame-line glass-panel p-5",children:[h.jsxs("div",{className:"mb-3 flex items-center gap-2.5",children:[h.jsx("span",{className:`grid h-9 w-9 shrink-0 place-items-center rounded-lg ${d?"bg-status-danger-bg text-status-danger-text":"bg-chip-indigo-bg text-chip-indigo-text"}`,children:h.jsx(Wy,{className:"h-5 w-5"})}),h.jsx("h2",{id:"confirm-dialog-title",className:"text-sm font-semibold text-ink",children:r})]}),h.jsx("p",{className:"mb-5 whitespace-pre-line text-xs text-ink-secondary",children:a}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx("button",{ref:x,type:"button",onClick:m,className:"min-h-9 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:s}),h.jsx("button",{type:"button",onClick:f,className:`min-h-9 rounded-lg border px-4 text-sm font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400 ${d?"border-status-danger-border bg-status-danger-bg/30 text-status-danger-text hover:bg-status-danger-bg/60":"btn-primary border-transparent bg-indigo-600 text-white hover:bg-indigo-500"}`,children:u})]})]})}):null}const B4=";",Uy="=";function H4(n){const r=n.trim().toLowerCase();return r==="extension"||r==="file_ext"||r==="filetype"?"ext":r==="directory"||r==="path"||r==="folder"?"dir":r==="recurse"||r==="recursive_search"?"recursive":r==="filter_text"||r==="query"||r==="search"?"filter":r}function By(n){const r=n.trim();if(!r.includes(Uy))return{values:{filter:r},isPlainFilter:!0};const a={};for(const u of r.split(B4)){const s=u.trim();if(!s)continue;const d=s.indexOf(Uy);if(d===-1)continue;const f=H4(s.slice(0,d)),m=s.slice(d+1).trim();switch(f){case"filter":a.filter=m;break;case"ext":a.ext=m;break;case"recursive":a.recursive=Hy(m,!0);break;case"dir":a.dir=m;break;case"scan":a.scan=Hy(m,!1);break}}return{values:a,isPlainFilter:!1}}function Hy(n,r){const a=n.toLowerCase();return["0","false","no","off"].includes(a)?!1:["1","true","yes","on"].includes(a)?!0:r}function nu(n){return/[",\n\r]/.test(n)?`"${n.replace(/"/g,'""')}"`:n}function q4(n,r,a,u){var p,x;const s=[],f=[["Exported",new Date().toISOString()],["App Version",(a==null?void 0:a.release)??"unknown"],["Config File",(a==null?void 0:a.config_path)??"none"],["Config Exists",String((a==null?void 0:a.config_exists)??!1)],["Directory",(a==null?void 0:a.active_directory)??""],["Extensions",((p=a==null?void 0:a.extensions)==null?void 0:p.join(" | "))??""],["Filter Text",u??((x=a==null?void 0:a.filters)==null?void 0:x[0])??""],["Recursive",String((a==null?void 0:a.recursive_search)??!0)],["Title",(a==null?void 0:a.title)??""],["Release",(a==null?void 0:a.release)??""]];for(const[y,g]of f)s.push(`${nu(y)},${nu(g)}`);s.push("");const m=r.length>0?r:["filename","path","rel_path"];s.push(m.map(nu).join(","));for(const y of n){const g=m.map(w=>w in y?nu(String(y[w]??"")):nu(y.column_values[w]??""));s.push(g.join(","))}return s.join(`\r -`)}const F4=120,qy=800,V4=4e3,Fy=20;function Y4(){const[n,r]=_.useState("dark"),[a,u]=_.useState(null),[s,d]=_.useState(null),[f,m]=_.useState(""),[p,x]=_.useState(""),[y,g]=_.useState(""),[w,v]=_.useState(!0),[S,T]=_.useState([]),[L,D]=_.useState(0),[$,I]=_.useState(!1),[J,ie]=_.useState(!1),[U,R]=_.useState(null),[Q,fe]=_.useState(!1),[B,ne]=_.useState(null),[V,se]=_.useState(0),[ve,ae]=_.useState(!1),A=_.useRef(0),W=_.useRef(null),le=_.useRef(null),[re,N]=_.useState(""),[qe,Ge]=_.useState(null),[M,E]=_.useState(!1),[Y,oe]=_.useState(null),[de,je]=_.useState(!1),[ye,_e]=_.useState("en"),[pe,Se]=_.useState(!1),[Rt,Bt]=_.useState(!1),[Gt,St]=_.useState(!1),[nt,Je]=_.useState(null),[en,bn]=_.useState(null),[tn,Ht]=_.useState(!1),[ge,Me]=_.useState(!1),[Le,lt]=_.useState(null),[K,ue]=_.useState(null),[ke,Ce]=_.useState(!1),ft=_.useRef(""),[it,Tt]=_.useState(!1),[nn,zn]=_.useState(void 0),[Dn,Mn]=_.useState(!1),[ll,Nt]=_.useState(null),[Et,Gn]=_.useState(0),Qt=_.useRef(null),il=_.useRef(null),he=(z,C="info")=>{z&&(oe({message:z,kind:C}),il.current&&clearTimeout(il.current),il.current=setTimeout(()=>oe(null),C==="error"?1e4:3500))},fu=()=>{il.current&&clearTimeout(il.current),oe(null)},xs=z=>{lt(z)},vn=()=>{var C;le.current&&(clearTimeout(le.current),le.current=null),(C=W.current)==null||C.abort(),W.current=new AbortController;const z=++A.current;return ae(!0),ie(!1),z},pt=z=>z===A.current,gt=z=>{pt(z)&&ae(!1)},jt=_.useRef(null);_.useEffect(()=>{if(!y.trim()){N("");return}const z=window.setTimeout(()=>N(y),F4);return()=>window.clearTimeout(z)},[y]);const Ke=_.useMemo(()=>re.trim()===""?S:S.filter(z=>Nk(z.rel_path,re)),[S,re]),ys=y.trim()&&S.length{const z=jt.current,C=z?Ke.findIndex(P=>P.path===z):-1;if(C>=0){se(P=>C!==P?C:P);return}se(P=>Math.min(P,Math.max(0,Ke.length-1)))},[Ke]);const du=async(z,C=B)=>{var we;const P=await Pf({offset:0,limit:ed,sort_by:C==null?void 0:C.column,sort_dir:C==null?void 0:C.direction,signal:(we=W.current)==null?void 0:we.signal});return pt(z)?(T(P.items),D(P.count),I(!0),!0):!1},On=async(z,C)=>{var P;return!pt(z)||(await Ex(C,(P=W.current)==null?void 0:P.signal),!pt(z)||!await du(z))?!1:(jt.current=null,se(0),!0)},lr=async()=>{if(J||S.length>=L)return;const z=A.current;ie(!0);try{const C=await Pf({offset:S.length,limit:ed,sort_by:B==null?void 0:B.column,sort_dir:B==null?void 0:B.direction});if(!pt(z))return;const P=new Set(S.map(we=>we.path||we.filename));T(we=>[...we,...C.items.filter(Oe=>!P.has(Oe.path||Oe.filename))]),D(C.count)}catch{he("Couldn't load more results — scroll to try again.","error")}finally{pt(z)&&ie(!1)}},Si=async()=>{if(de)return;je(!0),he("Reloading configuration...");const z=vn();try{const C=await Po();u(C);const P=await h2();d(P),r(zx(P.theme));const we=P.active_directory||f,Oe=P.extensions[0]??"",Ye=P.filters[0]??"";we&&m(we),x(Oe),g(Ye),v(P.recursive_search),P.reloaded===!1?he(`Config file not found: ${P.config_path||"(unknown path)"} — kept current configuration.`,"error"):he("Configuration reloaded."),we&&await On(z,{directory:we,extension:Oe,filter_text:Ye,recursive:P.recursive_search})}catch(C){he(`Failed to reload configuration: ${C.message}`,"error")}finally{je(!1),gt(z)}},ql=async z=>{const C=vn();d(z),r(zx(z.theme));const P=z.active_directory||f||(z.directories[0]??""),we=z.extensions[0]??"",Oe=z.filters[0]??"";if(P&&m(P),x(we),g(Oe),v(z.recursive_search),z.session_trial||he(z.config_exists?`Loaded config: ${z.config_path}`:"Starter configuration created."),P)try{await On(C,{directory:P,extension:we,filter_text:Oe,recursive:z.recursive_search})}catch(Ye){he(`Scan failed after config load: ${Ye.message}`,"error")}finally{gt(C)}else gt(C)},[wl,ir]=_.useState(!1),kl=_.useRef(Wo()),Ni=z=>{kl.current=z,ir(z.overlayVisible)},na=_.useRef(()=>{}),hu=async z=>{try{const C=await z.text(),P=await d2(z.name,C);await ql(P),he(`Session config applied: ${z.name}`)}catch(C){he(C.message||"Failed to apply dropped configuration","error")}};na.current=z=>{hu(z)};const Ei=_.useRef(0),Fl=_.useRef(async()=>{});_.useEffect(()=>{Fl.current=async()=>{const z=await Sx();await ql(z)}}),_.useEffect(()=>{const z=async()=>{let P=[];try{P=(await a2(Ei.current)).events}catch{return}for(const we of P){if(Ei.current=Math.max(Ei.current,we.id),we.config_applied)try{await Fl.current()}catch{}he(we.message)}},C=setInterval(()=>void z(),V4);return()=>clearInterval(C)},[]),_.useEffect(()=>{const z=Ye=>{var qt;return Array.from(((qt=Ye.dataTransfer)==null?void 0:qt.types)??[]).includes("Files")},C=Ye=>{Ni(Ax(kl.current,"enter",z(Ye)))},P=Ye=>{z(Ye)&&Ye.preventDefault()},we=Ye=>{Ni(Ax(kl.current,"leave",z(Ye)))},Oe=Ye=>{var Qe;Ye.preventDefault(),Ni(Wo());const qt=Array.from(((Qe=Ye.dataTransfer)==null?void 0:Qe.files)??[]),Re=C2(qt);if(!Re){qt.length>0&&he("Not a ProFiles configuration file.","error");return}na.current(Re)};return window.addEventListener("dragenter",C),window.addEventListener("dragover",P),window.addEventListener("dragleave",we),window.addEventListener("drop",Oe),()=>{window.removeEventListener("dragenter",C),window.removeEventListener("dragover",P),window.removeEventListener("dragleave",we),window.removeEventListener("drop",Oe)}},[]);const bs=()=>{Se(!0)},mu=async z=>{const C=vn();Se(!1),m(z),he(`Directory selected: ${z}`);let P;try{P=await Nx(z),d(P)}catch(Ye){console.error("select-directory failed:",Ye)}if(!pt(C))return;const we=P!=null&&P.extensions.includes(p)?p:(P==null?void 0:P.extensions[0])??p,Oe=P!=null&&P.filters.includes(y)?y:(P==null?void 0:P.filters[0])??y;x(we),g(Oe);try{await On(C,{directory:z,extension:we,filter_text:Oe,recursive:w})}catch(Ye){pt(C)&&he(`Scan failed: ${Ye.message}`,"error")}finally{gt(C)}},pu=async(z,C)=>{if(!pt(C))return;const P=z.theme==="auto"?"dark":z.theme==="light"?"light":"dark";r(P);try{localStorage.setItem("profiles-theme",P)}catch{}d(z);const we=z.active_directory||(z.directories.length>0?z.directories[0]:""),Oe=z.extensions.length>0?z.extensions[0]:"",Ye=z.filters.length>0?z.filters[0]:"";if(we&&m(we),Oe&&x(Oe),z.recursive_search!==void 0&&v(z.recursive_search),Ye&&g(Ye),z.config_exists||Bt(!0),we)try{await On(C,{directory:we,extension:Oe,filter_text:Ye,recursive:z.recursive_search})}catch(qt){pt(C)&&he(`Initial scan failed: ${qt.message}`,"error")}},la=async()=>{var C;(C=W.current)==null||C.abort(),W.current=new AbortController;const z=++A.current;R(null),fe(!0);try{const P=await Po();u(P);const we=await Sx();await pu(we,z)}catch(P){R((P==null?void 0:P.message)||"Couldn't fetch system info or configuration.")}finally{fe(!1)}};_.useEffect(()=>{la()},[]),_.useEffect(()=>()=>{var z;le.current&&(clearTimeout(le.current),le.current=null),(z=W.current)==null||z.abort()},[]);const Vl=async z=>{const C=vn();m(z);try{const P=await Nx(z);if(!pt(C))return;d(P);const we=P.extensions.includes(p)?p:P.extensions[0]??"",Oe=P.filters.includes(y)?y:P.filters[0]??"";x(we),g(Oe),await On(C,{directory:z,extension:we,filter_text:Oe,recursive:w})}catch(P){pt(C)&&he(`Directory change failed: ${P.message}`,"error")}finally{gt(C)}},rl=async()=>{if(!f)return;const z=vn();try{await On(z,{directory:f,extension:p,filter_text:y,recursive:w})}catch(C){pt(z)&&he(`Scan failed: ${(C==null?void 0:C.message)??C}`,"error")}finally{gt(z)}},Sl=_.useRef(rl);_.useEffect(()=>{Sl.current=rl});const gu=z=>{g(z),le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{le.current=null,Sl.current()},qy)},Qn=z=>{v(z),le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{le.current=null,Sl.current()},qy)},Lt=async()=>{if(g(""),!f)return;const z=vn();try{await On(z,{directory:f,extension:p,filter_text:"",recursive:w})}catch(C){pt(z)&&he(`Scan failed: ${(C==null?void 0:C.message)??C}`,"error")}finally{gt(z)}},ln=async()=>{if(v(!1),!f)return;const z=vn();try{await On(z,{directory:f,extension:p,filter_text:y,recursive:!1})}catch(C){pt(z)&&he(`Scan failed: ${C.message}`,"error")}finally{gt(z)}},wn=async(z,C)=>{if(z.has_hook){ue({file:z,args:C});return}try{await x2({directory:f,filename:z.rel_path,release:s==null?void 0:s.release,args:C}),he(`Launched ${z.filename}`)}catch(P){he(`Launch error: ${P.message}`,"error")}},ia=()=>{Ke.length>0&&Ke[V]&&wn(Ke[V])},vs=z=>{var C;jt.current=((C=Ke[z])==null?void 0:C.path)??null,se(z)},ws=async(z,C)=>{wn(z,C)},xu=async z=>{try{await Yy(z.path),he("Revealed in file manager.")}catch(C){he(`Error: ${C.message}`,"error")}},ji=async z=>{try{await yd(z.path),he("Folder opened in file manager.")}catch(C){he(`Error: ${C.message}`,"error")}},rr=async z=>{try{const C=await jx(z.path);he(C.message||"Terminal opened.")}catch(C){he(`Error: ${C.message}`,"error")}},ar=async z=>{try{await Vl(z),he(`Scanned directory: ${z}`)}catch(C){he(`Error: ${C.message}`,"error")}},Nl=z=>{g(z);const C=vn();On(C,{directory:f,extension:p,filter_text:z,recursive:w}).catch(P=>{pt(C)&&he(`Scan failed: ${(P==null?void 0:P.message)??P}`,"error")}).finally(()=>gt(C))},Yl=z=>{x(z);const C=vn();On(C,{directory:f,extension:z,filter_text:y,recursive:w}).catch(P=>{pt(C)&&he(`Scan failed: ${(P==null?void 0:P.message)??P}`,"error")}).finally(()=>gt(C))},Ci=async(z,C)=>{const P=C?z.path.replace(/\\/g,"/"):z.path;try{await navigator.clipboard.writeText(P),he("Path copied to clipboard.")}catch(we){he(`Copy failed: ${(we==null?void 0:we.message)??we}`,"error")}},Gl=async(z,C)=>{let P=z.filename;if(C){const we=P.lastIndexOf(".");we!==-1&&(P=P.slice(0,we))}try{await navigator.clipboard.writeText(P),he("Filename copied to clipboard.")}catch(we){he(`Copy failed: ${(we==null?void 0:we.message)??we}`,"error")}},_t=async(z,C)=>{try{he(`Computing ${C.toUpperCase()}...`);const P=await Cx(z.path,C);await navigator.clipboard.writeText(P.hash),he(`${C.toUpperCase()} hash copied: ${P.hash.slice(0,12)}...`)}catch(P){he(`Hash computation failed: ${P.message}`,"error")}},yu=async z=>{try{const C=new URL("file:///").href+z.path.replace(/\\/g,"/");await navigator.clipboard.writeText(C),he("File URI copied to clipboard.")}catch(C){he(`URI copy failed: ${C.message}`,"error")}},bu=async(z,C)=>{try{const P=await navigator.clipboard.readText();if(!P.trim()){he("Clipboard is empty — copy a hash first, then try again.");return}he(`Computing ${C.toUpperCase()}...`);const Oe=(await Cx(z.path,C)).hash.toLowerCase()===P.trim().toLowerCase();he(Oe?`✅ ${C.toUpperCase()} matches!`:`❌ ${C.toUpperCase()} mismatch`)}catch(P){he(`Verification failed: ${P.message}`,"error")}},ra=z=>{bn(z),St(!0)},El=z=>{Je(z)},Ql=async()=>{const z=nt;if(Je(null),!!z)try{if(he("Deleting file..."),!(await fetch("/api/actions/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:z.path})})).ok)throw new Error("Failed to delete file");he("File deleted successfully."),rl()}catch(C){he(`Delete failed: ${C.message}`,"error")}},ks=z=>{zn(z.path),Tt(!0)},aa=async()=>{if(f)try{await yd(f),he("Directory opened in file manager.")}catch(z){he(`Error: ${z.message}`,"error")}},vu=async z=>{if(z)try{await jx(z),he("Terminal opened in directory.")}catch(C){he(`Error: ${C.message}`,"error")}},wu=async()=>{try{await Vl("~"),he("Directory set to home folder.")}catch(z){he(`Error: ${z.message}`,"error")}},Pe=async()=>{if(f)try{const z=await g2(f);z.parent_path?(await Vl(z.parent_path),he("Moved to parent directory.")):he("Already at root directory.")}catch(z){he(`Error: ${z.message}`,"error")}},ku=async()=>{if(S.length===0){he("No files to export.");return}try{const z=q4(S,(s==null?void 0:s.column_names)||[],s??void 0,y),C=`profiles-export-${new Date().toISOString().slice(0,19).replace(/[:.]/g,"-")}.csv`,P=await v2(z,C);he(`Exported ${S.length} loaded row${S.length===1?"":"s"}${y?` matching "${y}"`:""} — ${P.message}`)}catch(z){he(`Export failed: ${z.message}`,"error")}},ur=async z=>{var Re,Qe;Mn(!1),he("Barcode detected!");const P=By(z).values,we=P.dir!==void 0?P.dir:f,Oe=P.ext!==void 0?P.ext:p,Ye=P.filter!==void 0?P.filter:y,qt=P.recursive!==void 0?P.recursive:w;if(P.dir!==void 0&&m(P.dir),P.ext!==void 0&&x(P.ext),P.filter!==void 0&&g(P.filter),P.recursive!==void 0&&v(P.recursive),we){const at=vn();try{await Ex({directory:we,extension:Oe,filter_text:Ye,recursive:qt},(Re=W.current)==null?void 0:Re.signal);const al=await Pf({offset:0,limit:ed,sort_by:B==null?void 0:B.column,sort_dir:B==null?void 0:B.direction,signal:(Qe=W.current)==null?void 0:Qe.signal});if(!pt(at))return;T(al.items),D(al.count),I(!0),jt.current=null,se(0),al.count===1&&al.items.length===1&&Nt(al.items[0])}catch(al){pt(at)&&he(`Scan error: ${al.message}`,"error")}finally{gt(at)}}},or=()=>{Ce(z=>{const C=!z;return C?(ft.current="",he("Barcode mode ON — scan a barcode now.")):(ft.current="",he("Barcode mode OFF.")),C})},Xn=z=>{z.filter!==void 0&&g(z.filter),z.ext!==void 0&&x(z.ext),z.recursive!==void 0&&v(z.recursive),z.dir!==void 0&&m(z.dir),(z.scan===!0||z.filter!==void 0||z.ext!==void 0||z.recursive!==void 0||z.dir!==void 0)&&(Ce(!1),ft.current="",setTimeout(()=>{Sl.current()},50))};_.useEffect(()=>{if(!ke)return;const z=C=>{const P=C.target;if(!(P instanceof HTMLElement&&(P.isContentEditable||P instanceof HTMLInputElement||P instanceof HTMLTextAreaElement||P instanceof HTMLSelectElement)))if(C.key==="Enter"){const Oe=ft.current;if(!Oe){ft.current="";return}C.preventDefault(),ft.current="";const Ye=By(Oe);if(Ye.isPlainFilter)he(`Barcode filter: ${Ye.values.filter}`),g(Ye.values.filter||""),Ce(!1),setTimeout(()=>void Sl.current(),50);else{const qt=Ye.values,Re=Object.entries(qt).map(([Qe,at])=>`${Qe}=${at}`).join(", ");he(`Barcode applied: ${Re}`),Xn(qt)}}else C.key==="Escape"?(Ce(!1),ft.current="",he("Barcode mode cancelled.")):C.key.length===1&&!C.ctrlKey&&!C.metaKey&&!C.altKey&&(ft.current+=C.key)};return document.addEventListener("keydown",z,!0),()=>document.removeEventListener("keydown",z,!0)},[ke]),_.useEffect(()=>(Et>0&&(Qt.current=setInterval(()=>{Sl.current()},Et*1e3)),()=>{Qt.current&&(clearInterval(Qt.current),Qt.current=null)}),[Et]);const un=z=>{Gn(z),z>0?he(`Auto-rescan every ${z}s.`):he("Auto-rescan disabled.")},ua=!!(qe||M||pe||Rt||Gt||tn||ge||it||Dn||ll||K||nt);return _.useEffect(()=>{const z=C=>{var we,Oe,Ye,qt;if(C.key==="Escape"){Ge(null),E(!1),Ht(!1),Me(!1),Ni(Wo());return}if(ua)return;if(C.ctrlKey&&!C.shiftKey&&C.key.toLowerCase()==="l"){C.preventDefault(),(we=document.querySelector("[data-testid='file-list']"))==null||we.focus();return}const P=C.target;if(!(P instanceof HTMLElement&&P.closest("button, a, [role='menuitem'], [role='option'], [role='columnheader'], [role='separator']"))){if(P instanceof HTMLInputElement||P instanceof HTMLSelectElement){C.key==="Enter"&&rl();return}if(C.key==="ContextMenu"||C.shiftKey&&C.key==="F10"){const Re=Ke[V];if(!Re)return;C.preventDefault();const Qe=document.querySelector(`[data-row-index="${V}"]`),at=Qe==null?void 0:Qe.getBoundingClientRect();Ge({x:at?at.left+24:24,y:at?at.top+at.height/2:24,file:Re});return}if(C.key==="F5"){C.preventDefault(),rl();return}if(C.ctrlKey&&C.key.toLowerCase()==="r"){C.preventDefault(),Si();return}if(C.ctrlKey&&C.key.toLowerCase()==="d"){C.preventDefault(),(Oe=document.querySelector("#directory-combobox"))==null||Oe.focus();return}if(C.ctrlKey&&C.key.toLowerCase()==="e"){C.preventDefault(),(Ye=document.querySelector("#extension-combobox"))==null||Ye.focus();return}if(C.ctrlKey&&C.key.toLowerCase()==="f"){C.preventDefault(),(qt=document.querySelector("#filter-combobox"))==null||qt.focus();return}if(C.ctrlKey&&C.shiftKey&&C.key.toLowerCase()==="l"){C.preventDefault(),Ht(Re=>!Re);return}if(C.ctrlKey&&C.key===","){C.preventDefault(),Tx().then(Re=>he(Re.message));return}if(C.ctrlKey&&C.shiftKey&&C.key.toLowerCase()==="t"){C.preventDefault(),r(Re=>Re==="dark"?"light":"dark");return}if(C.ctrlKey&&!C.shiftKey&&C.key.toLowerCase()==="b"){C.preventDefault(),Ce(Re=>!Re);return}if(C.ctrlKey&&C.shiftKey&&C.key.toLowerCase()==="b"){C.preventDefault(),Mn(Re=>!Re);return}if(C.ctrlKey&&!C.shiftKey&&C.key.toLowerCase()==="t"){C.preventDefault(),Me(!0);return}if(C.ctrlKey&&!C.shiftKey&&C.key.toLowerCase()==="h"){C.preventDefault(),wu();return}if(C.key==="?"||C.ctrlKey&&C.key==="/"){C.preventDefault(),E(Re=>!Re);return}if(C.key.toLowerCase()==="p"&&!C.ctrlKey&&!C.shiftKey&&!C.altKey){const Re=Ke[V];Re&&(C.preventDefault(),ra(Re));return}C.key==="ArrowDown"?(C.preventDefault(),se(Re=>{var at;const Qe=Math.min(Re+1,Math.max(0,Ke.length-1));return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Qe})):C.key==="ArrowUp"?(C.preventDefault(),se(Re=>{var at;const Qe=Math.max(Re-1,0);return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Qe})):C.key==="Home"?(C.preventDefault(),se(Re=>{var Qe;return jt.current=((Qe=Ke[0])==null?void 0:Qe.path)??null,Re===0?Re:0})):C.key==="End"?(C.preventDefault(),se(Re=>{var at;const Qe=Math.max(0,Ke.length-1);return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Re===Qe?Re:Qe})):C.key==="PageUp"?(C.preventDefault(),se(Re=>{var at;const Qe=Math.max(Re-Fy,0);return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Qe})):C.key==="PageDown"?(C.preventDefault(),se(Re=>{var at;const Qe=Math.min(Re+Fy,Math.max(0,Ke.length-1));return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Qe})):C.key==="Enter"&&(C.preventDefault(),ia())}};return window.addEventListener("keydown",z),()=>window.removeEventListener("keydown",z)},[ua,Ke,V,f,p,y,w,ke]),_.useEffect(()=>{document.documentElement.setAttribute("data-theme",n);try{localStorage.setItem("profiles-theme",n)}catch{}},[n]),h.jsxs("div",{className:"flex h-dvh flex-col bg-elevated/30 p-1 font-sans text-ink transition-colors duration-200 sm:p-1.5",children:[h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-frame-line bg-app shadow-[0_2px_6px_rgb(0_0_0/0.35)] transition-colors duration-200 sm:rounded-xl",children:[h.jsx(xk,{title:(s==null?void 0:s.title)||"",release:(s==null?void 0:s.release)||"",directories:(s==null?void 0:s.directories)||[],activeDirectory:f,onDirectoryChange:Vl,onBrowseDirectory:bs,onGoToParentDirectory:Pe,onGoToHomeDirectory:wu,onOpenActiveDirectory:aa,onOpenTerminal:vu}),h.jsx(jk,{extensions:(s==null?void 0:s.extensions)||[],activeExtension:p,onExtensionChange:x,filterOptions:(s==null?void 0:s.filters)||[],filterText:y,onFilterTextChange:gu,recursive:w,onRecursiveChange:Qn,onScan:rl,scanning:ve,barcodeMode:ke,onBarcodeToggle:or,onCameraBarcodeClick:()=>Mn(!0),autoRescanActive:Et>0,onTimerClick:()=>Me(!0)}),U?h.jsx(yk,{message:U,onRetry:()=>void la(),retrying:Q}):h.jsx(gk,{files:Ke,totalCount:L,rawLoadedCount:S.length,onLoadMore:lr,loadingMore:J,scanning:ve,hasScanned:$,activeDirectory:f,recursive:w,onDisableRecursive:ln,onOpenDirectory:aa,onOpenConfig:()=>Bt(!0),filterText:y,onClearFilter:Lt,columnHeaders:(s==null?void 0:s.column_headers)||[],columnNames:(s==null?void 0:s.column_names)||[],selectedIndex:V,onSelectIndex:vs,prefilterNote:ys,onLaunch:wn,onContextMenu:(z,C,P)=>{z.preventDefault(),jt.current=C.path,se(P),Ge({x:z.clientX,y:z.clientY,file:C})},rowColors:(s==null?void 0:s.row_colors)||[],sort:B,onSortChange:z=>{ne(z),jt.current=null,se(0);const C=vn();du(C,z).catch(P=>{pt(C)&&he(`Sort failed: ${P.message}`,"error")}).finally(()=>gt(C))}}),h.jsx(ak,{onExecute:ia,scanning:ve,scanningDirectory:f,hasSelection:Ke.length>0,fileCount:Ke.length,totalCount:L,toastMessage:Y,onToastDismiss:fu}),h.jsx(Ik,{systemInfo:a,fileCount:L,theme:n,onToggleTheme:()=>r(z=>z==="dark"?"light":"dark"),onOpenLog:()=>Ht(!0),onOpenConfig:async()=>{try{const z=await Tx();he(z.message)}catch(z){he(`Failed to open config: ${z.message}`,"error")}},onLoadConfig:()=>Bt(!0),onShowShortcuts:()=>E(!0),onReloadConfig:Si,onExport:ku,exportDisabled:S.length===0||ve,language:ye,onLanguageChange:_e,activeConfigName:s!=null&&s.config_path?s.config_path.split(/[\\/]/).pop()||s.config_path:void 0,lanEnabled:(a==null?void 0:a.lan_enabled)??null,onToggleLan:xs})]}),h.jsx(Dk,{isOpen:Rt,activeConfigPath:s==null?void 0:s.config_path,configExists:s==null?void 0:s.config_exists,onClose:()=>Bt(!1),onLoaded:ql}),h.jsx(mk,{visible:wl,onFileSelected:z=>na.current(z)}),h.jsx(hk,{isOpen:pe,initialPath:f,onClose:()=>Se(!1),onSelect:mu}),h.jsx(uk,{position:qe,onClose:()=>Ge(null),onLaunch:wn,onLaunchWithArgs:ws,onReveal:xu,onOpenFolder:ji,onOpenTerminal:rr,onScanDirectory:ar,onFilterFolder:Nl,onFilterExtension:Yl,onCopyPath:Ci,onCopyFilename:Gl,onCopyUri:yu,onComputeHash:_t,onVerifyHash:bu,onProperties:ra,onClearFile:El,onGenerateBarcode:ks,showToast:he}),h.jsx(zk,{isOpen:M,onClose:()=>E(!1)}),h.jsx(Uk,{isOpen:Gt,file:en,onLaunch:wn,onClose:()=>{St(!1),bn(null)}}),h.jsx(Zk,{isOpen:ge,currentInterval:Et,onClose:()=>Me(!1),onSetInterval:un}),h.jsx(Ak,{isOpen:tn,onClose:()=>Ht(!1),onOpenExternally:()=>{u2().then(z=>he(z.message))}}),h.jsx(U4,{isOpen:!!K,onClose:()=>ue(null),directory:f,filename:(K==null?void 0:K.file.rel_path)||"",release:s==null?void 0:s.release,args:K==null?void 0:K.args,onFinished:(z,C)=>{z==="completed"?he(C||"Workflow launched successfully."):(z==="aborted"||z==="failed")&&he(`Workflow stopped: ${C}`,"error")}}),h.jsx(nb,{isOpen:it,onClose:()=>{Tt(!1),zn(void 0)},initialFilePath:nn}),h.jsx(Qk,{isOpen:Dn,onClose:()=>Mn(!1),onDetected:ur}),h.jsx(Ly,{isOpen:!!nt,title:"Delete file",message:`Delete this file? +`))}function p(v,S,T,L){const D=T.enter("tableCell"),$=T.enter("phrasing"),I=T.containerPhrasing(v,{...L,before:d,after:d});return $(),D(),I}function x(v,S){return t5(v,{align:S,alignDelimiters:u,padding:a,stringLength:s})}function y(v,S,T){const L=v.children;let D=-1;const $=[],I=S.enter("table");for(;++D0&&!a&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const d4={tokenize:v4,partial:!0};function h4(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:x4,continuation:{tokenize:y4},exit:b4}},text:{91:{name:"gfmFootnoteCall",tokenize:g4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:m4,resolveTo:p4}}}}function m4(n,r,a){const u=this;let s=u.events.length;const d=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let f;for(;s--;){const p=u.events[s][1];if(p.type==="labelImage"){f=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return m;function m(p){if(!f||!f._balanced)return a(p);const x=tl(u.sliceSerialize({start:f.end,end:u.now()}));return x.codePointAt(0)!==94||!d.includes(x.slice(1))?a(p):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(p),n.exit("gfmFootnoteCallLabelMarker"),r(p))}}function p4(n,r){let a=n.length;for(;a--;)if(n[a][1].type==="labelImage"&&n[a][0]==="enter"){n[a][1];break}n[a+1][1].type="data",n[a+3][1].type="gfmFootnoteCallLabelMarker";const u={type:"gfmFootnoteCall",start:Object.assign({},n[a+3][1].start),end:Object.assign({},n[n.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},n[a+3][1].end),end:Object.assign({},n[a+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const d={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},d.start),end:Object.assign({},d.end)},m=[n[a+1],n[a+2],["enter",u,r],n[a+3],n[a+4],["enter",s,r],["exit",s,r],["enter",d,r],["enter",f,r],["exit",f,r],["exit",d,r],n[n.length-2],n[n.length-1],["exit",u,r]];return n.splice(a,n.length-a+1,...m),n}function g4(n,r,a){const u=this,s=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let d=0,f;return m;function m(g){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),p}function p(g){return g!==94?a(g):(n.enter("gfmFootnoteCallMarker"),n.consume(g),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",x)}function x(g){if(d>999||g===93&&!f||g===null||g===91||mt(g))return a(g);if(g===93){n.exit("chunkString");const w=n.exit("gfmFootnoteCallString");return s.includes(tl(u.sliceSerialize(w)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),r):a(g)}return mt(g)||(f=!0),d++,n.consume(g),g===92?y:x}function y(g){return g===91||g===92||g===93?(n.consume(g),d++,x):x(g)}}function x4(n,r,a){const u=this,s=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let d,f=0,m;return p;function p(S){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(S),n.exit("gfmFootnoteDefinitionLabelMarker"),x}function x(S){return S===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(S),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",y):a(S)}function y(S){if(f>999||S===93&&!m||S===null||S===91||mt(S))return a(S);if(S===93){n.exit("chunkString");const T=n.exit("gfmFootnoteDefinitionLabelString");return d=tl(u.sliceSerialize(T)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(S),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),w}return mt(S)||(m=!0),f++,n.consume(S),S===92?g:y}function g(S){return S===91||S===92||S===93?(n.consume(S),f++,y):y(S)}function w(S){return S===58?(n.enter("definitionMarker"),n.consume(S),n.exit("definitionMarker"),s.includes(d)||s.push(d),et(n,v,"gfmFootnoteDefinitionWhitespace")):a(S)}function v(S){return r(S)}}function y4(n,r,a){return n.check(su,r,n.attempt(d4,r,a))}function b4(n){n.exit("gfmFootnoteDefinition")}function v4(n,r,a){const u=this;return et(n,s,"gfmFootnoteDefinitionIndent",5);function s(d){const f=u.events[u.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(d):a(d)}}function w4(n){let a=(n||{}).singleTilde;const u={name:"strikethrough",tokenize:d,resolveAll:s};return a==null&&(a=!0),{text:{126:u},insideSpan:{null:[u]},attentionMarkers:{null:[126]}};function s(f,m){let p=-1;for(;++p1?p(S):(f.consume(S),g++,v);if(g<2&&!a)return p(S);const L=f.exit("strikethroughSequenceTemporary"),D=wi(S);return L._open=!D||D===2&&!!T,L._close=!T||T===2&&!!D,m(S)}}}class k4{constructor(){this.map=[],this.index=new Map}add(r,a,u){S4(this,r,a,u)}consume(r){if(this.map.sort(function(d,f){return d[0]-f[0]}),this.map.length===0)return;let a=this.map.length;const u=[];for(;a>0;)a-=1,u.push(r.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),r.length=this.map[a][0];u.push(r.slice()),r.length=0;let s=u.pop();for(;s;){for(const d of s)r.push(d);s=u.pop()}this.map.length=0,this.index.clear()}}function S4(n,r,a,u){if(a===0&&u.length===0)return;const s=n.index.get(r);if(s){s[1]+=a,s[2].push(...u);return}const d=[r,a,u];n.map.push(d),n.index.set(r,d)}function N4(n,r){let a=!1;const u=[];for(;r-1;){const{type:ve}=u.events[ne][1];if(ve==="lineEnding"||ve==="linePrefix")ne--;else break}const V=ne>-1?u.events[ne][1].type:null,se=V==="tableHead"||V==="tableRow"?U:p;return se===U&&u.parser.lazy[u.now().line]?a(B):se(B)}function p(B){return n.enter("tableHead"),n.enter("tableRow"),x(B)}function x(B){return B===124||(f=!0,d+=1),y(B)}function y(B){return B===null?a(B):Te(B)?d>1?(d=0,u.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(B),n.exit("lineEnding"),v):a(B):Ve(B)?et(n,y,"whitespace")(B):(d+=1,f&&(f=!1,s+=1),B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),f=!0,y):(n.enter("data"),g(B)))}function g(B){return B===null||B===124||mt(B)?(n.exit("data"),y(B)):(n.consume(B),B===92?w:g)}function w(B){return B===92||B===124?(n.consume(B),g):g(B)}function v(B){return u.interrupt=!1,u.parser.lazy[u.now().line]?a(B):(n.enter("tableDelimiterRow"),f=!1,Ve(B)?et(n,S,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):S(B))}function S(B){return B===45||B===58?L(B):B===124?(f=!0,n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),T):ie(B)}function T(B){return Ve(B)?et(n,L,"whitespace")(B):L(B)}function L(B){return B===58?(d+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),D):B===45?(d+=1,D(B)):B===null||Te(B)?J(B):ie(B)}function D(B){return B===45?(n.enter("tableDelimiterFiller"),$(B)):ie(B)}function $(B){return B===45?(n.consume(B),$):B===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),I):(n.exit("tableDelimiterFiller"),I(B))}function I(B){return Ve(B)?et(n,J,"whitespace")(B):J(B)}function J(B){return B===124?S(B):B===null||Te(B)?!f||s!==d?ie(B):(n.exit("tableDelimiterRow"),n.exit("tableHead"),r(B)):ie(B)}function ie(B){return a(B)}function U(B){return n.enter("tableRow"),R(B)}function R(B){return B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),R):B===null||Te(B)?(n.exit("tableRow"),r(B)):Ve(B)?et(n,R,"whitespace")(B):(n.enter("data"),Q(B))}function Q(B){return B===null||B===124||mt(B)?(n.exit("data"),R(B)):(n.consume(B),B===92?fe:Q)}function fe(B){return B===92||B===124?(n.consume(B),Q):Q(B)}}function C4(n,r){let a=-1,u=!0,s=0,d=[0,0,0,0],f=[0,0,0,0],m=!1,p=0,x,y,g;const w=new k4;for(;++aa[2]+1){const S=a[2]+1,T=a[3]-a[2]-1;n.add(S,T,[])}}n.add(a[3]+1,0,[["exit",g,r]])}return s!==void 0&&(d.end=Object.assign({},Ir(r.events,s)),n.add(s,0,[["exit",d,r]]),d=void 0),d}function Oy(n,r,a,u,s){const d=[],f=Ir(r.events,a);s&&(s.end=Object.assign({},f),d.push(["exit",s,r])),u.end=Object.assign({},f),d.push(["exit",u,r]),n.add(a+1,0,d)}function Ir(n,r){const a=n[r],u=a[0]==="enter"?"start":"end";return a[1][u]}const T4={name:"tasklistCheck",tokenize:A4};function _4(){return{text:{91:T4}}}function A4(n,r,a){const u=this;return s;function s(p){return u.previous!==null||!u._gfmTasklistFirstContentOfListItem?a(p):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(p),n.exit("taskListCheckMarker"),d)}function d(p){return mt(p)?(n.enter("taskListCheckValueUnchecked"),n.consume(p),n.exit("taskListCheckValueUnchecked"),f):p===88||p===120?(n.enter("taskListCheckValueChecked"),n.consume(p),n.exit("taskListCheckValueChecked"),f):a(p)}function f(p){return p===93?(n.enter("taskListCheckMarker"),n.consume(p),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),m):a(p)}function m(p){return Te(p)?r(p):Ve(p)?n.check({tokenize:z4},r,a)(p):a(p)}}function z4(n,r,a){return et(n,u,"whitespace");function u(s){return s===null?a(s):r(s)}}function D4(n){return bb([l4(),h4(),w4(n),E4(),_4()])}const M4={};function O4(n){const r=this,a=n||M4,u=r.data(),s=u.micromarkExtensions||(u.micromarkExtensions=[]),d=u.fromMarkdownExtensions||(u.fromMarkdownExtensions=[]),f=u.toMarkdownExtensions||(u.toMarkdownExtensions=[]);s.push(D4(a)),d.push(W5()),f.push(e4(a))}function R4(n){return n.replace(/\\n/g,` +`).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\'/g,"'").replace(/\\\\/g,"\\")}const L4={h1:({children:n})=>h.jsx("h3",{className:"mt-3 mb-1.5 text-base font-bold text-ink first:mt-0",children:n}),h2:({children:n})=>h.jsx("h4",{className:"mt-3 mb-1 text-sm font-semibold text-ink first:mt-0",children:n}),h3:({children:n})=>h.jsx("h5",{className:"mt-2 mb-1 text-xs font-semibold text-ink first:mt-0",children:n}),p:({children:n})=>h.jsx("p",{className:"my-1.5 leading-relaxed first:mt-0 last:mb-0",children:n}),strong:({children:n})=>h.jsx("strong",{className:"font-semibold text-ink",children:n}),em:({children:n})=>h.jsx("em",{className:"italic text-ink-secondary",children:n}),del:({children:n})=>h.jsx("del",{className:"text-ink-muted line-through",children:n}),a:({children:n,href:r})=>h.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-chip-indigo-text underline underline-offset-2 hover:text-ink",children:n}),code:({children:n,className:r})=>h.jsx("code",{className:`break-words rounded bg-elevated px-1 py-0.5 font-mono text-chip-indigo-text whitespace-pre-wrap ${r??""}`,children:n}),pre:({children:n})=>h.jsx("pre",{className:"my-2 overflow-x-auto rounded-lg border border-line bg-elevated p-3 font-mono text-xs text-ink [&_code]:bg-transparent [&_code]:px-0 [&_code]:py-0 [&_code]:text-inherit",children:n}),ul:({children:n})=>h.jsx("ul",{className:"my-1.5 list-disc space-y-0.5 pl-5",children:n}),ol:({children:n})=>h.jsx("ol",{className:"my-1.5 list-decimal space-y-0.5 pl-5",children:n}),li:({children:n})=>h.jsx("li",{className:"leading-relaxed",children:n}),blockquote:({children:n})=>h.jsx("blockquote",{className:"my-2 border-l-2 border-line-strong pl-3 text-ink-secondary italic",children:n}),table:({children:n})=>h.jsx("div",{className:"my-2 overflow-x-auto",children:h.jsx("table",{className:"w-full border-collapse text-xs",children:n})}),th:({children:n})=>h.jsx("th",{className:"border border-line bg-elevated px-2 py-1 text-left font-semibold",children:n}),td:({children:n})=>h.jsx("td",{className:"border border-line px-2 py-1 align-top",children:n}),hr:()=>h.jsx("hr",{className:"my-3 border-line"}),img:({alt:n,src:r,title:a})=>h.jsx("img",{src:r,alt:n,title:a,loading:"lazy",referrerPolicy:"no-referrer",className:"my-2 max-w-full rounded-lg border border-line"})};function $o({text:n}){return n?h.jsx(fj,{remarkPlugins:[O4,kj],components:L4,children:R4(n)}):null}function m0(n){return n==="completed"||n==="aborted"||n==="failed"}function tu({label:n}){return h.jsx("kbd",{"aria-hidden":"true",className:"ml-1.5 inline-block rounded border border-line/60 bg-elevated/60 px-1 py-px font-mono text-[10px] font-normal leading-none opacity-90",children:n})}function Ry(n){!n||m0(n.status)||E2(n.session_id).catch(()=>{})}const U4={running:"running",completed:"done",skipped:"skipped",failed:"failed",pending:"pending"};function Jo({text:n}){const[r,a]=_.useState(!1),u=_.useRef(void 0);_.useEffect(()=>()=>window.clearTimeout(u.current),[]);const s=async()=>{try{await navigator.clipboard.writeText(n),a(!0),window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!1),1500)}catch{}};return h.jsx("button",{type:"button",onClick:s,"aria-label":r?"Copied":"Copy content",title:r?"Copied!":"Copy content",className:"absolute right-2 top-2 rounded-md p-1.5 text-ink-muted hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:r?h.jsx(vi,{className:"h-3.5 w-3.5"}):h.jsx(yn,{className:"h-3.5 w-3.5"})})}function B4({isOpen:n,onClose:r,directory:a,filename:u,release:s,args:d,onFinished:f}){var Ge,M;const[m,p]=_.useState(null),[x,y]=_.useState(!1),[g,w]=_.useState(null),[v,S]=_.useState(null),[T,L]=_.useState(!1),[D,$]=_.useState(0),I=_.useRef(null),J=_.useRef(!1),ie=_.useRef(null),U=_.useRef(!1);_.useEffect(()=>{if(!n||!a||!u){p(null),w(null),L(!1),S(null),U.current=!1;return}let E=!0;return y(!0),w(null),L(!1),S(null),S2({directory:a,filename:u,release:s,args:d}).then(Y=>{E&&(p(Y),y(!1),(Y.status==="completed"||Y.status==="aborted"||Y.status==="failed")&&(f==null||f(Y.status,Y.final_message||"")))}).catch(Y=>{E&&((Y==null?void 0:Y.status)===404&&L(!0),w(Y.message||"Failed to start workflow"),y(!1))}),()=>{E=!1}},[n,a,u,s,d,D]);const R=async E=>{if(!(!m||J.current)){J.current=!0,y(!0);try{const Y=await N2(m.session_id,E);p(Y),(Y.status==="completed"||Y.status==="aborted"||Y.status==="failed")&&(f==null||f(Y.status,Y.final_message||""))}catch(Y){(Y==null?void 0:Y.status)===404?(L(!0),w(Y.message||"Workflow session on the server has expired.")):w(Y.message||"Failed to process workflow response")}finally{J.current=!1,y(!1)}}},Q=_.useRef(m);Q.current=m;const fe=_.useRef(R);fe.current=R;const B=_.useRef(v);B.current=v;const ne=_.useRef([]),V=(E,Y)=>{var je,ye;if(E.key!=="ArrowDown"&&E.key!=="ArrowUp"&&E.key!=="Home"&&E.key!=="End")return;E.preventDefault();const oe=((je=Q.current)==null?void 0:je.steps.length)??0;if(oe===0)return;const he=E.key==="ArrowDown"?(Y+1)%oe:E.key==="ArrowUp"?(Y-1+oe)%oe:E.key==="Home"?0:oe-1;S(he),(ye=ne.current[he])==null||ye.focus()};_.useEffect(()=>()=>Ry(Q.current),[]);const se=()=>{U.current||(U.current=!0,Ry(Q.current),r())},ve=()=>{p(null),w(null),L(!1),S(null),U.current=!1,$(E=>E+1)},ae=Wr({isOpen:n,onClose:se,dialogRef:I,initialFocusRef:ie});if(_.useEffect(()=>{if(!n)return;const E=Y=>{var Se,Rt,Bt;if(Y.key==="Escape"){Y.preventDefault(),se();return}const oe=Q.current;if(!oe)return;if(m0(oe.status)){Y.key==="Enter"&&!Y.repeat&&!Y.ctrlKey&&!Y.metaKey&&!Y.altKey&&!J.current&&((Se=Y.target)==null?void 0:Se.tagName)!=="BUTTON"&&((Rt=document.activeElement)==null?void 0:Rt.tagName)!=="BUTTON"&&(Y.preventDefault(),se());return}if(J.current||Y.repeat||Y.ctrlKey||Y.metaKey||Y.altKey)return;const he=Y.target;if((he==null?void 0:he.tagName)==="INPUT"||(he==null?void 0:he.tagName)==="TEXTAREA"||he!=null&&he.isContentEditable)return;const je=B.current,ye=je===null||je===oe.current_index,_e=oe.status==="waiting_ask"?"yes":oe.status==="waiting_notify"||oe.status==="waiting_notice"?"ack":null;if(!ye||_e===null)return;if(Y.key==="Enter"){const Gt=Y.target;if((Gt==null?void 0:Gt.tagName)==="BUTTON"||((Bt=document.activeElement)==null?void 0:Bt.tagName)==="BUTTON")return;Y.preventDefault(),fe.current(_e);return}if(oe.status!=="waiting_ask")return;const pe=Y.key.toLowerCase();pe==="y"?(Y.preventDefault(),fe.current("yes")):pe==="s"?(Y.preventDefault(),fe.current("skip")):pe==="n"&&(Y.preventDefault(),fe.current("no"))};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[n,r]),_.useEffect(()=>{if(!n||!m)return;const E=requestAnimationFrame(()=>{var Y;return(Y=ie.current)==null?void 0:Y.focus()});return()=>cancelAnimationFrame(E)},[n,m==null?void 0:m.status]),!n)return null;const A=v!==null?m==null?void 0:m.steps[v]:m==null?void 0:m.steps[m.current_index],W=(m==null?void 0:m.status)==="completed"||(m==null?void 0:m.status)==="aborted"||(m==null?void 0:m.status)==="failed",le=!!m&&!W&&!T&&(((Ge=m.status)==null?void 0:Ge.startsWith("waiting"))??!1),re=(((M=m==null?void 0:m.steps[(m==null?void 0:m.current_index)??-1])==null?void 0:M.phase)??"pre")==="post",qe=!T&&(v===null||v===(m==null?void 0:m.current_index))&&(A!=null&&A.command)&&((m==null?void 0:m.status)==="waiting_notify"||(m==null?void 0:m.status)==="waiting_notice"||(m==null?void 0:m.status)==="waiting_ask")?h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Command:"}),h.jsxs("div",{className:"relative rounded-lg border border-line bg-surface-strong p-4 pr-10 font-mono text-xs text-ink leading-relaxed",children:[h.jsx(Jo,{text:A.command}),A.command]})]}):null;return h.jsx("div",{ref:I,role:"dialog","aria-modal":"true","aria-labelledby":"workflow-runner-title",onKeyDown:ae,className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-xs",children:h.jsxs("div",{className:"animate-modal-in flex h-[80vh] w-full max-w-5xl flex-col rounded-xl border border-frame-line glass-panel overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-line px-5 py-3.5 bg-surface-strong/30 shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-2.5",children:[h.jsx("span",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-chip-indigo-bg text-chip-indigo-text",children:h.jsx(tb,{className:"h-4 w-4"})}),h.jsxs("div",{children:[h.jsx("h2",{id:"workflow-runner-title",className:"text-sm font-semibold text-ink",children:"Launch Workflow Engine"}),h.jsxs("p",{className:"text-xs text-ink-muted",children:[u," ",m!=null&&m.pattern?`• Pattern: ${m.pattern}`:""]})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[m&&!W&&!T&&h.jsxs("button",{type:"button",disabled:!le||x,onClick:()=>R("bypass"),title:re?"Skip the remaining post-launch steps":"Skip the remaining steps and launch with the OS default app",className:"btn inline-flex items-center gap-1.5 rounded-md border border-line bg-surface px-3 py-1.5 text-xs font-medium text-status-warning-text hover:bg-status-warning-bg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 disabled:cursor-not-allowed disabled:opacity-40",children:[h.jsx(Vw,{className:"h-3.5 w-3.5"}),re?"Skip rest":"Launch now"]}),h.jsx("button",{type:"button",onClick:se,className:"rounded-md p-1.5 text-ink-muted hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:h.jsx(nl,{className:"h-4 w-4"})})]})]}),h.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[h.jsxs("div",{className:"w-72 border-r border-line bg-surface-strong/20 p-4 overflow-y-auto flex flex-col gap-2 shrink-0",children:[h.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-ink-muted px-1 mb-1",children:"Workflow Steps (Click to inspect)"}),m&&m.steps.length>0?h.jsx("ul",{role:"list",className:"flex flex-col gap-2",children:m.steps.map((E,Y)=>{const oe=m.current_index===Y&&!W,he=v===Y||v===null&&oe,je=U4[E.status];return h.jsx("li",{children:h.jsxs("button",{ref:ye=>{ne.current[Y]=ye},type:"button",tabIndex:he?0:-1,"aria-current":he?"step":void 0,onKeyDown:ye=>V(ye,Y),onClick:()=>S(Y),className:`flex items-start text-left gap-2.5 rounded-lg border px-3 py-2.5 transition-colors cursor-pointer w-full ${he?"border-chip-indigo-border bg-chip-indigo-bg shadow-xs ring-1 ring-chip-indigo-border/40":"border-line/60 bg-surface/60 hover:bg-elevated/80"}`,children:[h.jsxs("div",{className:"mt-0.5 shrink-0",children:[E.status==="running"&&h.jsx(Wi,{className:"h-4 w-4 animate-spin text-chip-indigo-text"}),E.status==="completed"&&h.jsx(Mx,{className:"h-4 w-4 text-status-success-text"}),E.status==="skipped"&&h.jsx(mw,{className:"h-4 w-4 text-status-warning-text"}),E.status==="failed"&&h.jsx(lu,{className:"h-4 w-4 text-status-danger-text"}),E.status==="pending"&&h.jsx("div",{className:"h-4 w-4 rounded-full border border-line-strong flex items-center justify-center text-[10px] text-ink-faint font-mono",children:E.index})]}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"font-mono text-[11px] font-bold uppercase text-chip-indigo-text",children:E.action}),h.jsxs("span",{className:"text-[10px] font-mono text-ink-faint",children:["#",E.index," · ",je]})]}),h.jsx("p",{className:"truncate font-mono text-[11px] text-ink-secondary mt-0.5",title:E.command,children:E.message?E.message.split(` +`)[0]:E.command}),E.note&&h.jsx("p",{className:"mt-1 text-[10px] text-ink-faint italic",children:E.note})]})]})},E.index)})}):h.jsx("div",{className:"p-4 text-center text-xs text-ink-faint",children:g||T?"Session unavailable — see the error panel.":"Loading steps..."})]}),h.jsxs("div",{className:"flex-1 flex flex-col bg-app",children:[h.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-6",children:h.jsx("div",{className:"space-y-6",children:h.jsxs("div",{className:"rounded-xl border border-line bg-surface p-5 shadow-xs space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"rounded bg-chip-indigo-bg px-2 py-0.5 font-mono text-xs font-semibold uppercase text-chip-indigo-text",children:(A==null?void 0:A.action)||(m==null?void 0:m.status)}),h.jsx("span",{className:"text-xs text-ink-muted",children:A?`Step ${A.index} of ${m==null?void 0:m.steps.length}`:"Status"}),v!==null&&v!==(m==null?void 0:m.current_index)&&h.jsx("button",{type:"button",onClick:()=>S(null),className:"text-[11px] text-chip-indigo-text hover:underline ml-2",children:"(Return to active step)"})]}),x&&h.jsx(Wi,{className:"h-4 w-4 animate-spin text-chip-indigo-text"})]}),h.jsxs("div",{className:"space-y-3 text-xs text-ink font-sans leading-relaxed",children:[(v===null||v===(m==null?void 0:m.current_index))&&(m==null?void 0:m.status)==="waiting_notify"&&m.notify_message&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Notification Message:"}),h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-ink",children:h.jsx($o,{text:m.notify_message})}),qe]}),(v===null||v===(m==null?void 0:m.current_index))&&(m==null?void 0:m.status)==="waiting_notice"&&m.notice_message&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Notice:"}),h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-ink",children:h.jsx($o,{text:m.notice_message})}),qe,h.jsx("p",{className:"text-[11px] text-ink-faint",children:"The command will run when you continue."})]}),(v===null||v===(m==null?void 0:m.current_index))&&(m==null?void 0:m.status)==="waiting_ask"&&m.ask_prompt&&h.jsxs("div",{className:"space-y-2",children:[m.ask_message&&h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-ink",children:h.jsx($o,{text:m.ask_message})}),h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-status-warning-text",children:"Confirmation Prompt:"}),h.jsx("div",{className:"rounded-lg border border-status-warning-border bg-status-warning-bg p-4 text-sm font-medium text-ink",children:m.ask_prompt}),qe]}),W&&v===null&&h.jsxs("div",{className:`rounded-xl border p-8 text-center space-y-4 ${(m==null?void 0:m.status)==="completed"?"border-status-success-border bg-status-success-bg text-status-success-text":"border-status-danger-border bg-status-danger-bg text-status-danger-text"}`,children:[h.jsx("div",{className:"inline-flex h-12 w-12 items-center justify-center rounded-full bg-surface/50 mx-auto",children:(m==null?void 0:m.status)==="completed"?h.jsx(Mx,{className:"h-6 w-6 text-status-success-text"}):h.jsx(lu,{className:"h-6 w-6 text-status-danger-text"})}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("h3",{className:"text-base font-bold",children:(m==null?void 0:m.status)==="completed"?"Workflow Finished":"Workflow Terminated"}),h.jsx("p",{className:"text-xs text-ink-secondary max-w-md mx-auto",children:(m==null?void 0:m.final_message)||"The launch sequence has ended."})]}),h.jsx("div",{className:"pt-2",children:h.jsx("button",{type:"button",onClick:r,className:"btn btn-primary px-8 py-2.5 font-bold shadow-lg",children:"Close Engine Runner"})})]}),W&&v===null&&(m==null?void 0:m.last_output)&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Command Output:"}),h.jsxs("div",{className:"relative",children:[h.jsx(Jo,{text:m.last_output}),h.jsx("pre",{className:"max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-line bg-surface-strong p-4 font-mono text-xs text-ink",children:m.last_output})]})]}),!T&&!(W&&v===null)&&!((v===null||v===(m==null?void 0:m.current_index))&&((m==null?void 0:m.status)==="waiting_notify"||(m==null?void 0:m.status)==="waiting_ask"||(m==null?void 0:m.status)==="waiting_notice"))&&h.jsxs("div",{className:"space-y-4",children:[(A==null?void 0:A.message)&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Message:"}),h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-xs text-ink",children:h.jsx($o,{text:A.message})})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Command:"}),h.jsx("div",{className:"relative rounded-lg border border-line bg-surface-strong p-4 font-mono text-xs text-ink leading-relaxed",children:A!=null&&A.command?h.jsxs(h.Fragment,{children:[h.jsx(Jo,{text:A.command}),h.jsx("span",{className:"block pr-8",children:A.command})]}):"Waiting..."})]}),(A==null?void 0:A.output)&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Output:"}),h.jsxs("div",{className:"relative",children:[h.jsx(Jo,{text:A.output}),h.jsx("pre",{className:"max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-line bg-surface-strong p-4 font-mono text-xs text-ink",children:A.output})]})]}),(A==null?void 0:A.ask)&&h.jsxs("div",{className:"rounded-lg border border-status-warning-border bg-status-warning-bg p-3 text-xs text-status-warning-text",children:[h.jsx("span",{className:"font-semibold",children:"Workflow Guard:"})," ",A.ask]}),(A==null?void 0:A.note)&&h.jsxs("div",{className:"rounded-lg border border-line bg-surface-strong p-3 text-xs text-ink-muted italic",children:[h.jsx("span",{className:"font-semibold text-ink-secondary not-italic uppercase text-[10px]",children:"Log:"})," ",A.note]})]})]})]})})}),(g||T)&&h.jsx("div",{className:"shrink-0 px-6 pt-3",children:h.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-status-danger-border bg-status-danger-bg p-3 text-xs text-status-danger-text",children:[h.jsx(lu,{className:"mt-0.5 h-4 w-4 shrink-0"}),h.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[h.jsx("p",{children:T?"Workflow session on the server has expired or ended.":g}),T?h.jsxs("div",{className:"space-y-2",children:[g&&h.jsxs("details",{className:"text-ink-muted",children:[h.jsx("summary",{className:"cursor-pointer select-none text-[11px] underline",children:"Raw error (for bug reports)"}),h.jsx("pre",{className:"mt-1 overflow-x-auto whitespace-pre-wrap break-words font-mono text-[11px]",children:g})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{type:"button",onClick:ve,className:"btn btn-primary px-4 py-1.5 text-xs font-semibold",children:"Restart workflow"}),h.jsx("button",{type:"button",onClick:se,className:"btn rounded-md border-line bg-surface px-4 py-1.5 text-xs",children:"Close"})]})]}):null]})]})}),h.jsxs("div",{className:"shrink-0 px-6 pt-4 pb-4 border-t border-line flex items-center justify-between bg-app",children:[h.jsx("div",{className:"text-xs text-ink-muted","aria-live":"polite",children:T?"Session unavailable — restart or close above.":(m==null?void 0:m.status)==="waiting_ask"&&(v===null||v===m.current_index)?"Action required to proceed:":(m==null?void 0:m.status)==="waiting_notify"&&(v===null||v===m.current_index)?"Acknowledge message to proceed:":(m==null?void 0:m.status)==="waiting_notice"&&(v===null||v===m.current_index)?"Continue to run the command:":W?"Session terminated.":"Step in progress..."}),h.jsxs("div",{className:"flex items-center gap-2",children:[!T&&(m==null?void 0:m.status)==="waiting_notice"&&(v===null||v===m.current_index)&&h.jsxs("button",{type:"button",ref:ie,disabled:x,onClick:()=>R("ack"),className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:["Run Command",h.jsx(tu,{label:"↵"})]}),!T&&(m==null?void 0:m.status)==="waiting_notify"&&(v===null||v===m.current_index)&&h.jsxs("button",{type:"button",ref:ie,disabled:x,onClick:()=>R("ack"),className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:["Continue Workflow",h.jsx(tu,{label:"↵"})]}),!T&&(m==null?void 0:m.status)==="waiting_ask"&&(v===null||v===m.current_index)&&h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",disabled:x,onClick:()=>R("no"),className:"btn rounded-md border-line bg-surface px-4 py-2 text-status-danger-text hover:bg-status-danger-bg",children:["Abort Launch",h.jsx(tu,{label:"N"})]}),h.jsxs("button",{type:"button",disabled:x,onClick:()=>R("skip"),className:"btn rounded-md border-line bg-surface px-4 py-2 text-status-warning-text hover:bg-status-warning-bg",children:["Skip Step",h.jsx(tu,{label:"S"})]}),h.jsxs("button",{type:"button",ref:ie,disabled:x,onClick:()=>R("yes"),className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:["Execute Step",h.jsx(tu,{label:"Y"})]})]}),W&&h.jsx("button",{type:"button",ref:ie,onClick:r,className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:"Close Runner"})]})]})]})]})]})})}function Ly({isOpen:n,title:r,message:a,confirmLabel:u="Confirm",cancelLabel:s="Cancel",danger:d=!1,onConfirm:f,onCancel:m}){const p=_.useRef(null),x=_.useRef(null),y=Wr({isOpen:n,onClose:m,dialogRef:p,initialFocusRef:x});return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",onClick:m,children:h.jsxs("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",onKeyDown:y,onClick:g=>g.stopPropagation(),className:"animate-modal-in w-[400px] max-w-full rounded-2xl border border-frame-line glass-panel p-5",children:[h.jsxs("div",{className:"mb-3 flex items-center gap-2.5",children:[h.jsx("span",{className:`grid h-9 w-9 shrink-0 place-items-center rounded-lg ${d?"bg-status-danger-bg text-status-danger-text":"bg-chip-indigo-bg text-chip-indigo-text"}`,children:h.jsx(eb,{className:"h-5 w-5"})}),h.jsx("h2",{id:"confirm-dialog-title",className:"text-sm font-semibold text-ink",children:r})]}),h.jsx("div",{className:"mb-5 whitespace-pre-line text-xs text-ink-secondary",children:a}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx("button",{ref:x,type:"button",onClick:m,className:"min-h-9 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:s}),h.jsx("button",{type:"button",onClick:f,className:`min-h-9 rounded-lg border px-4 text-sm font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400 ${d?"border-status-danger-border bg-status-danger-bg/30 text-status-danger-text hover:bg-status-danger-bg/60":"btn-primary border-transparent bg-indigo-600 text-white hover:bg-indigo-500"}`,children:u})]})]})}):null}function Uy({url:n,label:r,className:a="",onCopied:u,onCopyError:s}){const d=async()=>{try{await navigator.clipboard.writeText(n),u==null||u(n)}catch{s==null||s(n)}};return h.jsxs("span",{className:`flex items-center justify-between gap-2 ${a}`.trim(),children:[h.jsx("code",{className:"truncate font-mono text-[11px] text-ink",children:n}),h.jsx("button",{type:"button",onClick:d,"aria-label":r??`Copy ${n}`,title:r??"Copy",className:"focus-ring shrink-0 rounded p-1 text-ink-faint transition-colors hover:bg-elevated hover:text-ink",children:h.jsx(yn,{className:"h-3.5 w-3.5"})})]})}const H4=";",By="=";function q4(n){const r=n.trim().toLowerCase();return r==="extension"||r==="file_ext"||r==="filetype"?"ext":r==="directory"||r==="path"||r==="folder"?"dir":r==="recurse"||r==="recursive_search"?"recursive":r==="filter_text"||r==="query"||r==="search"?"filter":r}function Hy(n){const r=n.trim();if(!r.includes(By))return{values:{filter:r},isPlainFilter:!0};const a={};for(const u of r.split(H4)){const s=u.trim();if(!s)continue;const d=s.indexOf(By);if(d===-1)continue;const f=q4(s.slice(0,d)),m=s.slice(d+1).trim();switch(f){case"filter":a.filter=m;break;case"ext":a.ext=m;break;case"recursive":a.recursive=qy(m,!0);break;case"dir":a.dir=m;break;case"scan":a.scan=qy(m,!1);break}}return{values:a,isPlainFilter:!1}}function qy(n,r){const a=n.toLowerCase();return["0","false","no","off"].includes(a)?!1:["1","true","yes","on"].includes(a)?!0:r}function nu(n){return/[",\n\r]/.test(n)?`"${n.replace(/"/g,'""')}"`:n}function F4(n,r,a,u){var p,x;const s=[],f=[["Exported",new Date().toISOString()],["App Version",(a==null?void 0:a.release)??"unknown"],["Config File",(a==null?void 0:a.config_path)??"none"],["Config Exists",String((a==null?void 0:a.config_exists)??!1)],["Directory",(a==null?void 0:a.active_directory)??""],["Extensions",((p=a==null?void 0:a.extensions)==null?void 0:p.join(" | "))??""],["Filter Text",u??((x=a==null?void 0:a.filters)==null?void 0:x[0])??""],["Recursive",String((a==null?void 0:a.recursive_search)??!0)],["Title",(a==null?void 0:a.title)??""],["Release",(a==null?void 0:a.release)??""]];for(const[y,g]of f)s.push(`${nu(y)},${nu(g)}`);s.push("");const m=r.length>0?r:["filename","path","rel_path"];s.push(m.map(nu).join(","));for(const y of n){const g=m.map(w=>w in y?nu(String(y[w]??"")):nu(y.column_values[w]??""));s.push(g.join(","))}return s.join(`\r +`)}const V4=120,Fy=800,Y4=4e3,Vy=20;function G4(){const[n,r]=_.useState("dark"),[a,u]=_.useState(null),[s,d]=_.useState(null),[f,m]=_.useState(""),[p,x]=_.useState(""),[y,g]=_.useState(""),[w,v]=_.useState(!0),[S,T]=_.useState([]),[L,D]=_.useState(0),[$,I]=_.useState(!1),[J,ie]=_.useState(!1),[U,R]=_.useState(null),[Q,fe]=_.useState(!1),[B,ne]=_.useState(null),[V,se]=_.useState(0),[ve,ae]=_.useState(!1),A=_.useRef(0),W=_.useRef(null),le=_.useRef(null),[re,N]=_.useState(""),[qe,Ge]=_.useState(null),[M,E]=_.useState(!1),[Y,oe]=_.useState(null),[he,je]=_.useState(!1),[ye,_e]=_.useState("en"),[pe,Se]=_.useState(!1),[Rt,Bt]=_.useState(!1),[Gt,St]=_.useState(!1),[nt,Je]=_.useState(null),[en,vn]=_.useState(null),[tn,Ht]=_.useState(!1),[ge,Me]=_.useState(!1),[Le,lt]=_.useState(null),[K,ue]=_.useState(null),[ke,Ce]=_.useState(!1),ft=_.useRef(""),[it,Tt]=_.useState(!1),[nn,zn]=_.useState(void 0),[Dn,Mn]=_.useState(!1),[ll,Nt]=_.useState(null),[Et,Gn]=_.useState(0),Qt=_.useRef(null),il=_.useRef(null),de=(z,C="info")=>{z&&(oe({message:z,kind:C}),il.current&&clearTimeout(il.current),il.current=setTimeout(()=>oe(null),C==="error"?1e4:3500))},fu=()=>{il.current&&clearTimeout(il.current),oe(null)},xs=z=>{lt(z)},wn=()=>{var C;le.current&&(clearTimeout(le.current),le.current=null),(C=W.current)==null||C.abort(),W.current=new AbortController;const z=++A.current;return ae(!0),ie(!1),z},pt=z=>z===A.current,gt=z=>{pt(z)&&ae(!1)},jt=_.useRef(null);_.useEffect(()=>{if(!y.trim()){N("");return}const z=window.setTimeout(()=>N(y),V4);return()=>window.clearTimeout(z)},[y]);const Ke=_.useMemo(()=>re.trim()===""?S:S.filter(z=>Ek(z.rel_path,re)),[S,re]),ys=y.trim()&&S.length{const z=jt.current,C=z?Ke.findIndex(P=>P.path===z):-1;if(C>=0){se(P=>C!==P?C:P);return}se(P=>Math.min(P,Math.max(0,Ke.length-1)))},[Ke]);const du=async(z,C=B)=>{var we;const P=await Pf({offset:0,limit:ed,sort_by:C==null?void 0:C.column,sort_dir:C==null?void 0:C.direction,signal:(we=W.current)==null?void 0:we.signal});return pt(z)?(T(P.items),D(P.count),I(!0),!0):!1},On=async(z,C)=>{var P;return!pt(z)||(await Ex(C,(P=W.current)==null?void 0:P.signal),!pt(z)||!await du(z))?!1:(jt.current=null,se(0),!0)},lr=async()=>{if(J||S.length>=L)return;const z=A.current;ie(!0);try{const C=await Pf({offset:S.length,limit:ed,sort_by:B==null?void 0:B.column,sort_dir:B==null?void 0:B.direction});if(!pt(z))return;const P=new Set(S.map(we=>we.path||we.filename));T(we=>[...we,...C.items.filter(Oe=>!P.has(Oe.path||Oe.filename))]),D(C.count)}catch{de("Couldn't load more results — scroll to try again.","error")}finally{pt(z)&&ie(!1)}},Si=async()=>{if(he)return;je(!0),de("Reloading configuration...");const z=wn();try{const C=await Po();u(C);const P=await m2();d(P),r(zx(P.theme));const we=P.active_directory||f,Oe=P.extensions[0]??"",Ye=P.filters[0]??"";we&&m(we),x(Oe),g(Ye),v(P.recursive_search),P.reloaded===!1?de(`Config file not found: ${P.config_path||"(unknown path)"} — kept current configuration.`,"error"):de("Configuration reloaded."),we&&await On(z,{directory:we,extension:Oe,filter_text:Ye,recursive:P.recursive_search})}catch(C){de(`Failed to reload configuration: ${C.message}`,"error")}finally{je(!1),gt(z)}},ql=async z=>{const C=wn();d(z),r(zx(z.theme));const P=z.active_directory||f||(z.directories[0]??""),we=z.extensions[0]??"",Oe=z.filters[0]??"";if(P&&m(P),x(we),g(Oe),v(z.recursive_search),z.session_trial||de(z.config_exists?`Loaded config: ${z.config_path}`:"Starter configuration created."),P)try{await On(C,{directory:P,extension:we,filter_text:Oe,recursive:z.recursive_search})}catch(Ye){de(`Scan failed after config load: ${Ye.message}`,"error")}finally{gt(C)}else gt(C)},[wl,ir]=_.useState(!1),kl=_.useRef(Wo()),Ni=z=>{kl.current=z,ir(z.overlayVisible)},na=_.useRef(()=>{}),hu=async z=>{try{const C=await z.text(),P=await h2(z.name,C);await ql(P),de(`Session config applied: ${z.name}`)}catch(C){de(C.message||"Failed to apply dropped configuration","error")}};na.current=z=>{hu(z)};const Ei=_.useRef(0),Fl=_.useRef(async()=>{});_.useEffect(()=>{Fl.current=async()=>{const z=await Sx();await ql(z)}}),_.useEffect(()=>{const z=async()=>{let P=[];try{P=(await u2(Ei.current)).events}catch{return}for(const we of P){if(Ei.current=Math.max(Ei.current,we.id),we.config_applied)try{await Fl.current()}catch{}de(we.message)}},C=setInterval(()=>void z(),Y4);return()=>clearInterval(C)},[]),_.useEffect(()=>{const z=Ye=>{var qt;return Array.from(((qt=Ye.dataTransfer)==null?void 0:qt.types)??[]).includes("Files")},C=Ye=>{Ni(Ax(kl.current,"enter",z(Ye)))},P=Ye=>{z(Ye)&&Ye.preventDefault()},we=Ye=>{Ni(Ax(kl.current,"leave",z(Ye)))},Oe=Ye=>{var Qe;Ye.preventDefault(),Ni(Wo());const qt=Array.from(((Qe=Ye.dataTransfer)==null?void 0:Qe.files)??[]),Re=T2(qt);if(!Re){qt.length>0&&de("Not a ProFiles configuration file.","error");return}na.current(Re)};return window.addEventListener("dragenter",C),window.addEventListener("dragover",P),window.addEventListener("dragleave",we),window.addEventListener("drop",Oe),()=>{window.removeEventListener("dragenter",C),window.removeEventListener("dragover",P),window.removeEventListener("dragleave",we),window.removeEventListener("drop",Oe)}},[]);const bs=()=>{Se(!0)},mu=async z=>{const C=wn();Se(!1),m(z),de(`Directory selected: ${z}`);let P;try{P=await Nx(z),d(P)}catch(Ye){console.error("select-directory failed:",Ye)}if(!pt(C))return;const we=P!=null&&P.extensions.includes(p)?p:(P==null?void 0:P.extensions[0])??p,Oe=P!=null&&P.filters.includes(y)?y:(P==null?void 0:P.filters[0])??y;x(we),g(Oe);try{await On(C,{directory:z,extension:we,filter_text:Oe,recursive:w})}catch(Ye){pt(C)&&de(`Scan failed: ${Ye.message}`,"error")}finally{gt(C)}},pu=async(z,C)=>{if(!pt(C))return;const P=z.theme==="auto"?"dark":z.theme==="light"?"light":"dark";r(P);try{localStorage.setItem("profiles-theme",P)}catch{}d(z);const we=z.active_directory||(z.directories.length>0?z.directories[0]:""),Oe=z.extensions.length>0?z.extensions[0]:"",Ye=z.filters.length>0?z.filters[0]:"";if(we&&m(we),Oe&&x(Oe),z.recursive_search!==void 0&&v(z.recursive_search),Ye&&g(Ye),z.config_exists||Bt(!0),we)try{await On(C,{directory:we,extension:Oe,filter_text:Ye,recursive:z.recursive_search})}catch(qt){pt(C)&&de(`Initial scan failed: ${qt.message}`,"error")}},la=async()=>{var C;(C=W.current)==null||C.abort(),W.current=new AbortController;const z=++A.current;R(null),fe(!0);try{const P=await Po();u(P);const we=await Sx();await pu(we,z)}catch(P){R((P==null?void 0:P.message)||"Couldn't fetch system info or configuration.")}finally{fe(!1)}};_.useEffect(()=>{la()},[]),_.useEffect(()=>()=>{var z;le.current&&(clearTimeout(le.current),le.current=null),(z=W.current)==null||z.abort()},[]);const Vl=async z=>{const C=wn();m(z);try{const P=await Nx(z);if(!pt(C))return;d(P);const we=P.extensions.includes(p)?p:P.extensions[0]??"",Oe=P.filters.includes(y)?y:P.filters[0]??"";x(we),g(Oe),await On(C,{directory:z,extension:we,filter_text:Oe,recursive:w})}catch(P){pt(C)&&de(`Directory change failed: ${P.message}`,"error")}finally{gt(C)}},rl=async()=>{if(!f)return;const z=wn();try{await On(z,{directory:f,extension:p,filter_text:y,recursive:w})}catch(C){pt(z)&&de(`Scan failed: ${(C==null?void 0:C.message)??C}`,"error")}finally{gt(z)}},Sl=_.useRef(rl);_.useEffect(()=>{Sl.current=rl});const gu=z=>{g(z),le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{le.current=null,Sl.current()},Fy)},Qn=z=>{v(z),le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{le.current=null,Sl.current()},Fy)},Lt=async()=>{if(g(""),!f)return;const z=wn();try{await On(z,{directory:f,extension:p,filter_text:"",recursive:w})}catch(C){pt(z)&&de(`Scan failed: ${(C==null?void 0:C.message)??C}`,"error")}finally{gt(z)}},ln=async()=>{if(v(!1),!f)return;const z=wn();try{await On(z,{directory:f,extension:p,filter_text:y,recursive:!1})}catch(C){pt(z)&&de(`Scan failed: ${C.message}`,"error")}finally{gt(z)}},kn=async(z,C)=>{if(z.has_hook){ue({file:z,args:C});return}try{await y2({directory:f,filename:z.rel_path,release:s==null?void 0:s.release,args:C}),de(`Launched ${z.filename}`)}catch(P){de(`Launch error: ${P.message}`,"error")}},ia=()=>{Ke.length>0&&Ke[V]&&kn(Ke[V])},vs=z=>{var C;jt.current=((C=Ke[z])==null?void 0:C.path)??null,se(z)},ws=async(z,C)=>{kn(z,C)},xu=async z=>{try{await Gy(z.path),de("Revealed in file manager.")}catch(C){de(`Error: ${C.message}`,"error")}},ji=async z=>{try{await yd(z.path),de("Folder opened in file manager.")}catch(C){de(`Error: ${C.message}`,"error")}},rr=async z=>{try{const C=await jx(z.path);de(C.message||"Terminal opened.")}catch(C){de(`Error: ${C.message}`,"error")}},ar=async z=>{try{await Vl(z),de(`Scanned directory: ${z}`)}catch(C){de(`Error: ${C.message}`,"error")}},Nl=z=>{g(z);const C=wn();On(C,{directory:f,extension:p,filter_text:z,recursive:w}).catch(P=>{pt(C)&&de(`Scan failed: ${(P==null?void 0:P.message)??P}`,"error")}).finally(()=>gt(C))},Yl=z=>{x(z);const C=wn();On(C,{directory:f,extension:z,filter_text:y,recursive:w}).catch(P=>{pt(C)&&de(`Scan failed: ${(P==null?void 0:P.message)??P}`,"error")}).finally(()=>gt(C))},Ci=async(z,C)=>{const P=C?z.path.replace(/\\/g,"/"):z.path;try{await navigator.clipboard.writeText(P),de("Path copied to clipboard.")}catch(we){de(`Copy failed: ${(we==null?void 0:we.message)??we}`,"error")}},Gl=async(z,C)=>{let P=z.filename;if(C){const we=P.lastIndexOf(".");we!==-1&&(P=P.slice(0,we))}try{await navigator.clipboard.writeText(P),de("Filename copied to clipboard.")}catch(we){de(`Copy failed: ${(we==null?void 0:we.message)??we}`,"error")}},_t=async(z,C)=>{try{de(`Computing ${C.toUpperCase()}...`);const P=await Cx(z.path,C);await navigator.clipboard.writeText(P.hash),de(`${C.toUpperCase()} hash copied: ${P.hash.slice(0,12)}...`)}catch(P){de(`Hash computation failed: ${P.message}`,"error")}},yu=async z=>{try{const C=new URL("file:///").href+z.path.replace(/\\/g,"/");await navigator.clipboard.writeText(C),de("File URI copied to clipboard.")}catch(C){de(`URI copy failed: ${C.message}`,"error")}},bu=async(z,C)=>{try{const P=await navigator.clipboard.readText();if(!P.trim()){de("Clipboard is empty — copy a hash first, then try again.");return}de(`Computing ${C.toUpperCase()}...`);const Oe=(await Cx(z.path,C)).hash.toLowerCase()===P.trim().toLowerCase();de(Oe?`✅ ${C.toUpperCase()} matches!`:`❌ ${C.toUpperCase()} mismatch`)}catch(P){de(`Verification failed: ${P.message}`,"error")}},ra=z=>{vn(z),St(!0)},El=z=>{Je(z)},Ql=async()=>{const z=nt;if(Je(null),!!z)try{if(de("Deleting file..."),!(await fetch("/api/actions/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:z.path})})).ok)throw new Error("Failed to delete file");de("File deleted successfully."),rl()}catch(C){de(`Delete failed: ${C.message}`,"error")}},ks=z=>{zn(z.path),Tt(!0)},aa=async()=>{if(f)try{await yd(f),de("Directory opened in file manager.")}catch(z){de(`Error: ${z.message}`,"error")}},vu=async z=>{if(z)try{await jx(z),de("Terminal opened in directory.")}catch(C){de(`Error: ${C.message}`,"error")}},wu=async()=>{try{await Vl("~"),de("Directory set to home folder.")}catch(z){de(`Error: ${z.message}`,"error")}},Pe=async()=>{if(f)try{const z=await x2(f);z.parent_path?(await Vl(z.parent_path),de("Moved to parent directory.")):de("Already at root directory.")}catch(z){de(`Error: ${z.message}`,"error")}},ku=async()=>{if(S.length===0){de("No files to export.");return}try{const z=F4(S,(s==null?void 0:s.column_names)||[],s??void 0,y),C=`profiles-export-${new Date().toISOString().slice(0,19).replace(/[:.]/g,"-")}.csv`,P=await w2(z,C);de(`Exported ${S.length} loaded row${S.length===1?"":"s"}${y?` matching "${y}"`:""} — ${P.message}`)}catch(z){de(`Export failed: ${z.message}`,"error")}},ur=async z=>{var Re,Qe;Mn(!1),de("Barcode detected!");const P=Hy(z).values,we=P.dir!==void 0?P.dir:f,Oe=P.ext!==void 0?P.ext:p,Ye=P.filter!==void 0?P.filter:y,qt=P.recursive!==void 0?P.recursive:w;if(P.dir!==void 0&&m(P.dir),P.ext!==void 0&&x(P.ext),P.filter!==void 0&&g(P.filter),P.recursive!==void 0&&v(P.recursive),we){const at=wn();try{await Ex({directory:we,extension:Oe,filter_text:Ye,recursive:qt},(Re=W.current)==null?void 0:Re.signal);const al=await Pf({offset:0,limit:ed,sort_by:B==null?void 0:B.column,sort_dir:B==null?void 0:B.direction,signal:(Qe=W.current)==null?void 0:Qe.signal});if(!pt(at))return;T(al.items),D(al.count),I(!0),jt.current=null,se(0),al.count===1&&al.items.length===1&&Nt(al.items[0])}catch(al){pt(at)&&de(`Scan error: ${al.message}`,"error")}finally{gt(at)}}},or=()=>{Ce(z=>{const C=!z;return C?(ft.current="",de("Barcode mode ON — scan a barcode now.")):(ft.current="",de("Barcode mode OFF.")),C})},Xn=z=>{z.filter!==void 0&&g(z.filter),z.ext!==void 0&&x(z.ext),z.recursive!==void 0&&v(z.recursive),z.dir!==void 0&&m(z.dir),(z.scan===!0||z.filter!==void 0||z.ext!==void 0||z.recursive!==void 0||z.dir!==void 0)&&(Ce(!1),ft.current="",setTimeout(()=>{Sl.current()},50))};_.useEffect(()=>{if(!ke)return;const z=C=>{const P=C.target;if(!(P instanceof HTMLElement&&(P.isContentEditable||P instanceof HTMLInputElement||P instanceof HTMLTextAreaElement||P instanceof HTMLSelectElement)))if(C.key==="Enter"){const Oe=ft.current;if(!Oe){ft.current="";return}C.preventDefault(),ft.current="";const Ye=Hy(Oe);if(Ye.isPlainFilter)de(`Barcode filter: ${Ye.values.filter}`),g(Ye.values.filter||""),Ce(!1),setTimeout(()=>void Sl.current(),50);else{const qt=Ye.values,Re=Object.entries(qt).map(([Qe,at])=>`${Qe}=${at}`).join(", ");de(`Barcode applied: ${Re}`),Xn(qt)}}else C.key==="Escape"?(Ce(!1),ft.current="",de("Barcode mode cancelled.")):C.key.length===1&&!C.ctrlKey&&!C.metaKey&&!C.altKey&&(ft.current+=C.key)};return document.addEventListener("keydown",z,!0),()=>document.removeEventListener("keydown",z,!0)},[ke]),_.useEffect(()=>(Et>0&&(Qt.current=setInterval(()=>{Sl.current()},Et*1e3)),()=>{Qt.current&&(clearInterval(Qt.current),Qt.current=null)}),[Et]);const un=z=>{Gn(z),z>0?de(`Auto-rescan every ${z}s.`):de("Auto-rescan disabled.")},ua=!!(qe||M||pe||Rt||Gt||tn||ge||it||Dn||ll||K||nt);return _.useEffect(()=>{const z=C=>{var we,Oe,Ye,qt;if(C.key==="Escape"){Ge(null),E(!1),Ht(!1),Me(!1),Ni(Wo());return}if(ua)return;if(C.ctrlKey&&!C.shiftKey&&C.key.toLowerCase()==="l"){C.preventDefault(),(we=document.querySelector("[data-testid='file-list']"))==null||we.focus();return}const P=C.target;if(!(P instanceof HTMLElement&&P.closest("button, a, [role='menuitem'], [role='option'], [role='columnheader'], [role='separator']"))){if(P instanceof HTMLInputElement||P instanceof HTMLSelectElement){C.key==="Enter"&&rl();return}if(C.key==="ContextMenu"||C.shiftKey&&C.key==="F10"){const Re=Ke[V];if(!Re)return;C.preventDefault();const Qe=document.querySelector(`[data-row-index="${V}"]`),at=Qe==null?void 0:Qe.getBoundingClientRect();Ge({x:at?at.left+24:24,y:at?at.top+at.height/2:24,file:Re});return}if(C.key==="F5"){C.preventDefault(),rl();return}if(C.ctrlKey&&C.key.toLowerCase()==="r"){C.preventDefault(),Si();return}if(C.ctrlKey&&C.key.toLowerCase()==="d"){C.preventDefault(),(Oe=document.querySelector("#directory-combobox"))==null||Oe.focus();return}if(C.ctrlKey&&C.key.toLowerCase()==="e"){C.preventDefault(),(Ye=document.querySelector("#extension-combobox"))==null||Ye.focus();return}if(C.ctrlKey&&C.key.toLowerCase()==="f"){C.preventDefault(),(qt=document.querySelector("#filter-combobox"))==null||qt.focus();return}if(C.ctrlKey&&C.shiftKey&&C.key.toLowerCase()==="l"){C.preventDefault(),Ht(Re=>!Re);return}if(C.ctrlKey&&C.key===","){C.preventDefault(),Tx().then(Re=>de(Re.message));return}if(C.ctrlKey&&C.shiftKey&&C.key.toLowerCase()==="t"){C.preventDefault(),r(Re=>Re==="dark"?"light":"dark");return}if(C.ctrlKey&&!C.shiftKey&&C.key.toLowerCase()==="b"){C.preventDefault(),Ce(Re=>!Re);return}if(C.ctrlKey&&C.shiftKey&&C.key.toLowerCase()==="b"){C.preventDefault(),Mn(Re=>!Re);return}if(C.ctrlKey&&!C.shiftKey&&C.key.toLowerCase()==="t"){C.preventDefault(),Me(!0);return}if(C.ctrlKey&&!C.shiftKey&&C.key.toLowerCase()==="h"){C.preventDefault(),wu();return}if(C.key==="?"||C.ctrlKey&&C.key==="/"){C.preventDefault(),E(Re=>!Re);return}if(C.key.toLowerCase()==="p"&&!C.ctrlKey&&!C.shiftKey&&!C.altKey){const Re=Ke[V];Re&&(C.preventDefault(),ra(Re));return}C.key==="ArrowDown"?(C.preventDefault(),se(Re=>{var at;const Qe=Math.min(Re+1,Math.max(0,Ke.length-1));return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Qe})):C.key==="ArrowUp"?(C.preventDefault(),se(Re=>{var at;const Qe=Math.max(Re-1,0);return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Qe})):C.key==="Home"?(C.preventDefault(),se(Re=>{var Qe;return jt.current=((Qe=Ke[0])==null?void 0:Qe.path)??null,Re===0?Re:0})):C.key==="End"?(C.preventDefault(),se(Re=>{var at;const Qe=Math.max(0,Ke.length-1);return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Re===Qe?Re:Qe})):C.key==="PageUp"?(C.preventDefault(),se(Re=>{var at;const Qe=Math.max(Re-Vy,0);return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Qe})):C.key==="PageDown"?(C.preventDefault(),se(Re=>{var at;const Qe=Math.min(Re+Vy,Math.max(0,Ke.length-1));return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Qe})):C.key==="Enter"&&(C.preventDefault(),ia())}};return window.addEventListener("keydown",z),()=>window.removeEventListener("keydown",z)},[ua,Ke,V,f,p,y,w,ke]),_.useEffect(()=>{document.documentElement.setAttribute("data-theme",n);try{localStorage.setItem("profiles-theme",n)}catch{}},[n]),h.jsxs("div",{className:"flex h-dvh flex-col bg-elevated/30 p-1 font-sans text-ink transition-colors duration-200 sm:p-1.5",children:[h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-frame-line bg-app shadow-[0_2px_6px_rgb(0_0_0/0.35)] transition-colors duration-200 sm:rounded-xl",children:[h.jsx(yk,{title:(s==null?void 0:s.title)||"",release:(s==null?void 0:s.release)||"",directories:(s==null?void 0:s.directories)||[],activeDirectory:f,onDirectoryChange:Vl,onBrowseDirectory:bs,onGoToParentDirectory:Pe,onGoToHomeDirectory:wu,onOpenActiveDirectory:aa,onOpenTerminal:vu}),h.jsx(Ck,{extensions:(s==null?void 0:s.extensions)||[],activeExtension:p,onExtensionChange:x,filterOptions:(s==null?void 0:s.filters)||[],filterText:y,onFilterTextChange:gu,recursive:w,onRecursiveChange:Qn,onScan:rl,scanning:ve,barcodeMode:ke,onBarcodeToggle:or,onCameraBarcodeClick:()=>Mn(!0),autoRescanActive:Et>0,onTimerClick:()=>Me(!0)}),U?h.jsx(bk,{message:U,onRetry:()=>void la(),retrying:Q}):h.jsx(xk,{files:Ke,totalCount:L,rawLoadedCount:S.length,onLoadMore:lr,loadingMore:J,scanning:ve,hasScanned:$,activeDirectory:f,recursive:w,onDisableRecursive:ln,onOpenDirectory:aa,onOpenConfig:()=>Bt(!0),filterText:y,onClearFilter:Lt,columnHeaders:(s==null?void 0:s.column_headers)||[],columnNames:(s==null?void 0:s.column_names)||[],selectedIndex:V,onSelectIndex:vs,prefilterNote:ys,onLaunch:kn,onContextMenu:(z,C,P)=>{z.preventDefault(),jt.current=C.path,se(P),Ge({x:z.clientX,y:z.clientY,file:C})},rowColors:(s==null?void 0:s.row_colors)||[],sort:B,onSortChange:z=>{ne(z),jt.current=null,se(0);const C=wn();du(C,z).catch(P=>{pt(C)&&de(`Sort failed: ${P.message}`,"error")}).finally(()=>gt(C))}}),h.jsx(uk,{onExecute:ia,scanning:ve,scanningDirectory:f,hasSelection:Ke.length>0,fileCount:Ke.length,totalCount:L,toastMessage:Y,onToastDismiss:fu}),h.jsx(Kk,{systemInfo:a,fileCount:L,theme:n,onToggleTheme:()=>r(z=>z==="dark"?"light":"dark"),onOpenLog:()=>Ht(!0),onOpenConfig:async()=>{try{const z=await Tx();de(z.message)}catch(z){de(`Failed to open config: ${z.message}`,"error")}},onLoadConfig:()=>Bt(!0),onShowShortcuts:()=>E(!0),onReloadConfig:Si,onExport:ku,exportDisabled:S.length===0||ve,language:ye,onLanguageChange:_e,activeConfigName:s!=null&&s.config_path?s.config_path.split(/[\\/]/).pop()||s.config_path:void 0,lanEnabled:(a==null?void 0:a.lan_enabled)??null,onToggleLan:xs})]}),h.jsx(Mk,{isOpen:Rt,activeConfigPath:s==null?void 0:s.config_path,configExists:s==null?void 0:s.config_exists,onClose:()=>Bt(!1),onLoaded:ql}),h.jsx(pk,{visible:wl,onFileSelected:z=>na.current(z)}),h.jsx(mk,{isOpen:pe,initialPath:f,onClose:()=>Se(!1),onSelect:mu}),h.jsx(ok,{position:qe,onClose:()=>Ge(null),onLaunch:kn,onLaunchWithArgs:ws,onReveal:xu,onOpenFolder:ji,onOpenTerminal:rr,onScanDirectory:ar,onFilterFolder:Nl,onFilterExtension:Yl,onCopyPath:Ci,onCopyFilename:Gl,onCopyUri:yu,onComputeHash:_t,onVerifyHash:bu,onProperties:ra,onClearFile:El,onGenerateBarcode:ks,showToast:de}),h.jsx(Dk,{isOpen:M,onClose:()=>E(!1)}),h.jsx(Bk,{isOpen:Gt,file:en,onLaunch:kn,onClose:()=>{St(!1),vn(null)}}),h.jsx($k,{isOpen:ge,currentInterval:Et,onClose:()=>Me(!1),onSetInterval:un}),h.jsx(zk,{isOpen:tn,onClose:()=>Ht(!1),onOpenExternally:()=>{o2().then(z=>de(z.message))}}),h.jsx(B4,{isOpen:!!K,onClose:()=>ue(null),directory:f,filename:(K==null?void 0:K.file.rel_path)||"",release:s==null?void 0:s.release,args:K==null?void 0:K.args,onFinished:(z,C)=>{z==="completed"?de(C||"Workflow launched successfully."):(z==="aborted"||z==="failed")&&de(`Workflow stopped: ${C}`,"error")}}),h.jsx(lb,{isOpen:it,onClose:()=>{Tt(!1),zn(void 0)},initialFilePath:nn}),h.jsx(Xk,{isOpen:Dn,onClose:()=>Mn(!1),onDetected:ur}),h.jsx(Ly,{isOpen:!!nt,title:"Delete file",message:`Delete this file? ${(nt==null?void 0:nt.path)??""} -This action cannot be undone.`,confirmLabel:"Delete",danger:!0,onConfirm:Ql,onCancel:()=>Je(null)}),h.jsx(Ly,{isOpen:Le!==null,title:Le?"Enable LAN access?":"Restrict to this machine?",message:Le?`ProFiles will be reachable by anyone on this network: -http://${a==null?void 0:a.hostname}:${window.location.port} -http://${a==null?void 0:a.ip}:${window.location.port}`:"ProFiles will be reachable only on this machine.",confirmLabel:Le?"Enable LAN":"Restrict",onConfirm:async()=>{const z=Le;lt(null);try{await s2(z),he(z?"Updating LAN binding…":"Restricting ProFiles to this machine…","info");const C=await c2(z);C&&u(C),(C==null?void 0:C.lan_enabled)===z?he(z?"ProFiles is now reachable on the local network.":"ProFiles is restricted to this machine.","info"):he("Failed to update LAN binding — the previous address is still active.","error")}catch(C){const P=C instanceof Error?C.message:"Failed to update LAN binding";he(`Failed to update LAN binding: ${P}`,"error");const we=await Po();u(we)}},onCancel:()=>lt(null)}),h.jsx(Xk,{isOpen:!!ll,file:ll,onConfirm:()=>{if(ll){const z=ll;Nt(null),wn(z)}},onDismiss:()=>Nt(null)})]})}class G4 extends _.Component{constructor(){super(...arguments);Qf(this,"state",{error:null})}static getDerivedStateFromError(a){return{error:a}}componentDidCatch(a,u){console.error("Application render error:",a,u.componentStack)}render(){return this.state.error?h.jsx("main",{className:"flex min-h-screen items-center justify-center bg-app p-6 text-ink",children:h.jsxs("section",{className:"w-full max-w-lg rounded-lg border border-line bg-surface p-6",children:[h.jsx("h1",{className:"text-base font-semibold",children:"ProFiles encountered an error"}),h.jsx("p",{className:"mt-2 text-sm text-ink-secondary",children:"The interface could not continue. Reload the application to try again."}),h.jsxs("details",{className:"mt-4 text-xs text-ink-muted",children:[h.jsx("summary",{className:"cursor-pointer",children:"Error details"}),h.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap",children:this.state.error.message})]}),h.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"btn btn-primary mt-5 px-4 py-2 text-sm font-semibold",children:"Reload application"})]})}):this.props.children}}i2.createRoot(document.getElementById("root")).render(h.jsx(Jv.StrictMode,{children:h.jsx(G4,{children:h.jsx(Y4,{})})})); +This action cannot be undone.`,confirmLabel:"Delete",danger:!0,onConfirm:Ql,onCancel:()=>Je(null)}),h.jsx(Ly,{isOpen:Le!==null,title:Le?"Enable LAN access?":"Restrict to this machine?",message:Le?h.jsxs("span",{className:"block",children:["ProFiles will be reachable by anyone on this network:",h.jsx(Uy,{url:`http://${a==null?void 0:a.hostname}:${window.location.port}`,label:"Copy hostname URL",className:"mt-1.5",onCopied:()=>de("URL copied to clipboard."),onCopyError:()=>de("Failed to copy URL.","error")}),h.jsx(Uy,{url:`http://${a==null?void 0:a.ip}:${window.location.port}`,label:"Copy IP URL",className:"mt-1.5",onCopied:()=>de("URL copied to clipboard."),onCopyError:()=>de("Failed to copy URL.","error")})]}):"ProFiles will be reachable only on this machine.",confirmLabel:Le?"Enable LAN":"Restrict",onConfirm:async()=>{const z=Le;lt(null);try{await c2(z),de(z?"Updating LAN binding…":"Restricting ProFiles to this machine…","info");const C=await f2(z);C&&u(C),(C==null?void 0:C.lan_enabled)===z?de(z?"ProFiles is now reachable on the local network.":"ProFiles is restricted to this machine.","info"):de("Failed to update LAN binding — the previous address is still active.","error")}catch(C){const P=C instanceof Error?C.message:"Failed to update LAN binding";de(`Failed to update LAN binding: ${P}`,"error");const we=await Po();u(we)}},onCancel:()=>lt(null)}),h.jsx(Ik,{isOpen:!!ll,file:ll,onConfirm:()=>{if(ll){const z=ll;Nt(null),kn(z)}},onDismiss:()=>Nt(null)})]})}class Q4 extends _.Component{constructor(){super(...arguments);Qf(this,"state",{error:null})}static getDerivedStateFromError(a){return{error:a}}componentDidCatch(a,u){console.error("Application render error:",a,u.componentStack)}render(){return this.state.error?h.jsx("main",{className:"flex min-h-screen items-center justify-center bg-app p-6 text-ink",children:h.jsxs("section",{className:"w-full max-w-lg rounded-lg border border-line bg-surface p-6",children:[h.jsx("h1",{className:"text-base font-semibold",children:"ProFiles encountered an error"}),h.jsx("p",{className:"mt-2 text-sm text-ink-secondary",children:"The interface could not continue. Reload the application to try again."}),h.jsxs("details",{className:"mt-4 text-xs text-ink-muted",children:[h.jsx("summary",{className:"cursor-pointer",children:"Error details"}),h.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap",children:this.state.error.message})]}),h.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"btn btn-primary mt-5 px-4 py-2 text-sm font-semibold",children:"Reload application"})]})}):this.props.children}}r2.createRoot(document.getElementById("root")).render(h.jsx(Pv.StrictMode,{children:h.jsx(Q4,{children:h.jsx(G4,{})})})); diff --git a/src/profiles/web/dist/assets/index-DlrIRth4.css b/src/profiles/web/dist/assets/index-DlrIRth4.css deleted file mode 100644 index e7cc5ff..0000000 --- a/src/profiles/web/dist/assets/index-DlrIRth4.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-outline-style:solid;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-800:oklch(43.2% .095 166.913);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-900:oklch(20.8% .042 265.755);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-4xl:56rem;--container-5xl:64rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-xs:4px;--blur-sm:8px;--blur-md:12px;--blur-xl:24px;--aspect-video:16 / 9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components{.glass-panel{background:var(--app-glass-panel);-webkit-backdrop-filter:blur(24px)saturate(160%);backdrop-filter:blur(24px)saturate(160%);box-shadow:var(--app-panel-shadow),inset 0 1px 0 var(--app-glass-highlight)}.glass-panel-strong{background:var(--app-glass-panel-strong);-webkit-backdrop-filter:blur(28px)saturate(180%);backdrop-filter:blur(28px)saturate(180%);box-shadow:var(--app-panel-shadow),inset 0 1px 0 var(--app-glass-highlight)}.btn{justify-content:center;align-items:center;gap:calc(var(--spacing) * 1.5);border-radius:var(--radius-md);border-style:var(--tw-border-style);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));border-width:1px;display:inline-flex}.btn:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:#625fffb3}@supports (color:color-mix(in lab,red,red)){.btn:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 70%, transparent)}}.btn:focus-visible{--tw-outline-style:none;outline-style:none}.btn:disabled{cursor:not-allowed;opacity:.4}.btn-primary{background-color:var(--color-indigo-600);color:var(--color-white);border-color:#0000}@media(hover:hover){.btn-primary:hover{background-color:var(--color-indigo-500)}}.btn-secondary{border-color:var(--app-border);background-color:var(--app-elevated);color:var(--app-text-secondary)}@media(hover:hover){.btn-secondary:hover{border-color:var(--color-indigo-500);color:var(--app-text-primary)}.btn-chip:hover{--tw-brightness:brightness(95%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.btn-chip:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:#625fffb3}@supports (color:color-mix(in lab,red,red)){.btn-chip:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 70%, transparent)}}.btn-chip:focus-visible{--tw-outline-style:none;outline-style:none}.btn-chip:disabled{cursor:not-allowed;opacity:.4}.focus-ring:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:#625fffb3}@supports (color:color-mix(in lab,red,red)){.focus-ring:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 70%, transparent)}}.focus-ring:focus-visible{--tw-outline-style:none;outline-style:none}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{inset-block:0}.-top-1{top:calc(var(--spacing) * -1)}.top-0{top:0}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-full{top:100%}.-right-0\.5{right:calc(var(--spacing) * -.5)}.-right-1{right:calc(var(--spacing) * -1)}.right-0{right:0}.right-2{right:calc(var(--spacing) * 2)}.-bottom-0\.5{bottom:calc(var(--spacing) * -.5)}.-bottom-1{bottom:calc(var(--spacing) * -1)}.bottom-0{bottom:0}.bottom-2{bottom:calc(var(--spacing) * 2)}.-left-1{left:calc(var(--spacing) * -1)}.left-0{left:0}.left-1\/2{left:50%}.left-2\.5{left:calc(var(--spacing) * 2.5)}.left-3{left:calc(var(--spacing) * 3)}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-\[calc\(var\(--z-context-menu\)-1\)\]{z-index:calc(var(--z-context-menu) - 1)}.z-\[var\(--z-combobox-list\)\]{z-index:var(--z-combobox-list)}.z-\[var\(--z-context-menu\)\]{z-index:var(--z-context-menu)}.z-\[var\(--z-drop-overlay\)\]{z-index:var(--z-drop-overlay)}.z-\[var\(--z-modal\)\]{z-index:var(--z-modal)}.z-\[var\(--z-syntax-helper\)\]{z-index:var(--z-syntax-helper)}.z-\[var\(--z-toast\)\]{z-index:var(--z-toast)}.z-\[var\(--z-tooltip\)\]{z-index:var(--z-tooltip)}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:var(--spacing)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.my-1\.5{margin-block:calc(var(--spacing) * 1.5)}.my-2{margin-block:calc(var(--spacing) * 2)}.my-3{margin-block:calc(var(--spacing) * 3)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mr-1\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-auto{margin-right:auto}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:var(--spacing)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.ml-1\.5{margin-left:calc(var(--spacing) * 1.5)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-video{aspect-ratio:var(--aspect-video)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-48{height:calc(var(--spacing) * 48)}.h-\[80vh\]{height:80vh}.h-\[min\(84dvh\,760px\)\]{height:min(84dvh,760px)}.h-dvh{height:100dvh}.h-full{height:100%}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-\[60vh\]{max-height:60vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(100dvh-1\.5rem\)\]{max-height:calc(100dvh - 1.5rem)}.max-h-\[calc\(100dvh-16px\)\]{max-height:calc(100dvh - 16px)}.min-h-0{min-height:0}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-10{min-height:calc(var(--spacing) * 10)}.min-h-36{min-height:calc(var(--spacing) * 36)}.min-h-\[24px\]{min-height:24px}.min-h-\[44px\]{min-height:44px}.min-h-screen{min-height:100vh}.w-1\/3{width:33.3333%}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-44{width:calc(var(--spacing) * 44)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-72{width:calc(var(--spacing) * 72)}.w-96{width:calc(var(--spacing) * 96)}.w-\[52px\]{width:52px}.w-\[138px\]{width:138px}.w-\[150px\]{width:150px}.w-\[400px\]{width:400px}.w-\[420px\]{width:420px}.w-\[450px\]{width:450px}.w-\[clamp\(560px\,85vw\,1500px\)\]{width:clamp(560px,85vw,1500px)}.w-\[min\(94vw\,960px\)\]{width:min(94vw,960px)}.w-full{width:100%}.w-max{width:max-content}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-\[calc\(100vw-16px\)\]{max-width:calc(100vw - 16px)}.max-w-\[min\(70vw\,560px\)\]{max-width:min(70vw,560px)}.max-w-\[min\(80vw\,640px\)\]{max-width:min(80vw,640px)}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-48{min-width:calc(var(--spacing) * 48)}.min-w-\[100px\]{min-width:100px}.min-w-\[220px\]{min-width:220px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.basis-64{flex-basis:calc(var(--spacing) * 64)}.basis-full{flex-basis:100%}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize{resize:both}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-l-md{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.rounded-r-md{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-2{border-top-style:var(--tw-border-style);border-top-width:2px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-r-2{border-right-style:var(--tw-border-style);border-right-width:2px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-0{border-left-style:var(--tw-border-style);border-left-width:0}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-chip-amber-border{border-color:var(--chip-amber-border)}.border-chip-fuchsia-border{border-color:var(--chip-fuchsia-border)}.border-chip-indigo-border,.border-chip-indigo-border\/50{border-color:var(--chip-indigo-border)}@supports (color:color-mix(in lab,red,red)){.border-chip-indigo-border\/50{border-color:color-mix(in oklab,var(--chip-indigo-border) 50%,transparent)}}.border-chip-purple-border,.border-chip-purple-border\/50{border-color:var(--chip-purple-border)}@supports (color:color-mix(in lab,red,red)){.border-chip-purple-border\/50{border-color:color-mix(in oklab,var(--chip-purple-border) 50%,transparent)}}.border-chip-sky-border{border-color:var(--chip-sky-border)}.border-emerald-300\/50{border-color:#5ee9b580}@supports (color:color-mix(in lab,red,red)){.border-emerald-300\/50{border-color:color-mix(in oklab,var(--color-emerald-300) 50%,transparent)}}.border-emerald-500\/30{border-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/30{border-color:color-mix(in oklab,var(--color-emerald-500) 30%,transparent)}}.border-frame-line{border-color:var(--app-frame-border)}.border-indigo-400{border-color:var(--color-indigo-400)}.border-indigo-400\/80{border-color:#7d87ffcc}@supports (color:color-mix(in lab,red,red)){.border-indigo-400\/80{border-color:color-mix(in oklab,var(--color-indigo-400) 80%,transparent)}}.border-indigo-600{border-color:var(--color-indigo-600)}.border-line,.border-line\/40{border-color:var(--app-border)}@supports (color:color-mix(in lab,red,red)){.border-line\/40{border-color:color-mix(in oklab,var(--app-border) 40%,transparent)}}.border-line\/60{border-color:var(--app-border)}@supports (color:color-mix(in lab,red,red)){.border-line\/60{border-color:color-mix(in oklab,var(--app-border) 60%,transparent)}}.border-slate-500\/30{border-color:#62748e4d}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/30{border-color:color-mix(in oklab,var(--color-slate-500) 30%,transparent)}}.border-status-danger-border{border-color:var(--status-danger-border)}.border-status-success-border{border-color:var(--status-success-border)}.border-status-warning-border{border-color:var(--status-warning-border)}.border-transparent{border-color:#0000}.border-t-transparent{border-top-color:#0000}.border-l-transparent{border-left-color:#0000}.bg-app,.bg-app\/90{background-color:var(--app-bg)}@supports (color:color-mix(in lab,red,red)){.bg-app\/90{background-color:color-mix(in oklab,var(--app-bg) 90%,transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\/20{background-color:color-mix(in oklab,var(--color-black) 20%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-black\/65{background-color:#000000a6}@supports (color:color-mix(in lab,red,red)){.bg-black\/65{background-color:color-mix(in oklab,var(--color-black) 65%,transparent)}}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.bg-black\/70{background-color:color-mix(in oklab,var(--color-black) 70%,transparent)}}.bg-chip-amber-bg{background-color:var(--chip-amber-bg)}.bg-chip-fuchsia-bg{background-color:var(--chip-fuchsia-bg)}.bg-chip-indigo-bg,.bg-chip-indigo-bg\/20{background-color:var(--chip-indigo-bg)}@supports (color:color-mix(in lab,red,red)){.bg-chip-indigo-bg\/20{background-color:color-mix(in oklab,var(--chip-indigo-bg) 20%,transparent)}}.bg-chip-purple-bg{background-color:var(--chip-purple-bg)}.bg-chip-sky-bg{background-color:var(--chip-sky-bg)}.bg-elevated,.bg-elevated\/30{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-elevated\/30{background-color:color-mix(in oklab,var(--app-elevated) 30%,transparent)}}.bg-elevated\/50{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-elevated\/50{background-color:color-mix(in oklab,var(--app-elevated) 50%,transparent)}}.bg-elevated\/60{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-elevated\/60{background-color:color-mix(in oklab,var(--app-elevated) 60%,transparent)}}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-600{background-color:var(--color-emerald-600)}.bg-emerald-800\/60{background-color:#005f4699}@supports (color:color-mix(in lab,red,red)){.bg-emerald-800\/60{background-color:color-mix(in oklab,var(--color-emerald-800) 60%,transparent)}}.bg-indigo-500\/5{background-color:#625fff0d}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/5{background-color:color-mix(in oklab,var(--color-indigo-500) 5%,transparent)}}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-ink-faint{background-color:var(--app-text-faint)}.bg-slate-600\/20{background-color:#45556c33}@supports (color:color-mix(in lab,red,red)){.bg-slate-600\/20{background-color:color-mix(in oklab,var(--color-slate-600) 20%,transparent)}}.bg-status-danger-bg,.bg-status-danger-bg\/30{background-color:var(--status-danger-bg)}@supports (color:color-mix(in lab,red,red)){.bg-status-danger-bg\/30{background-color:color-mix(in oklab,var(--status-danger-bg) 30%,transparent)}}.bg-status-danger-bg\/40{background-color:var(--status-danger-bg)}@supports (color:color-mix(in lab,red,red)){.bg-status-danger-bg\/40{background-color:color-mix(in oklab,var(--status-danger-bg) 40%,transparent)}}.bg-status-success-bg{background-color:var(--status-success-bg)}.bg-status-warning-bg{background-color:var(--status-warning-bg)}.bg-surface{background-color:var(--app-surface)}.bg-surface-glass{background-color:var(--app-glass)}.bg-surface-strong,.bg-surface-strong\/20{background-color:var(--app-glass-strong)}@supports (color:color-mix(in lab,red,red)){.bg-surface-strong\/20{background-color:color-mix(in oklab,var(--app-glass-strong) 20%,transparent)}}.bg-surface-strong\/30{background-color:var(--app-glass-strong)}@supports (color:color-mix(in lab,red,red)){.bg-surface-strong\/30{background-color:color-mix(in oklab,var(--app-glass-strong) 30%,transparent)}}.bg-surface\/50{background-color:var(--app-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/50{background-color:color-mix(in oklab,var(--app-surface) 50%,transparent)}}.bg-surface\/60{background-color:var(--app-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/60{background-color:color-mix(in oklab,var(--app-surface) 60%,transparent)}}.bg-white{background-color:var(--color-white)}.bg-white\/90{background-color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.bg-white\/90{background-color:color-mix(in oklab,var(--color-white) 90%,transparent)}}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-chip-indigo-bg{--tw-gradient-from:var(--chip-indigo-bg);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-400\/90{--tw-gradient-from:#00d294e6}@supports (color:color-mix(in lab,red,red)){.from-emerald-400\/90{--tw-gradient-from:color-mix(in oklab, var(--color-emerald-400) 90%, transparent)}}.from-emerald-400\/90{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-chip-purple-bg{--tw-gradient-to:var(--chip-purple-bg);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-emerald-600\/90{--tw-gradient-to:#009767e6}@supports (color:color-mix(in lab,red,red)){.to-emerald-600\/90{--tw-gradient-to:color-mix(in oklab, var(--color-emerald-600) 90%, transparent)}}.to-emerald-600\/90{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.fill-current{fill:currentColor}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-px{padding-block:1px}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1{padding-right:var(--spacing)}.pr-2\.5{padding-right:calc(var(--spacing) * 2.5)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-5{padding-left:calc(var(--spacing) * 5)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.align-\[1px\]{vertical-align:1px}.align-top{vertical-align:top}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-chip-amber-text{color:var(--chip-amber-text)}.text-chip-fuchsia-text{color:var(--chip-fuchsia-text)}.text-chip-indigo-text{color:var(--chip-indigo-text)}.text-chip-purple-text{color:var(--chip-purple-text)}.text-chip-sky-text{color:var(--chip-sky-text)}.text-emerald-200{color:var(--color-emerald-200)}.text-ink{color:var(--app-text-primary)}.text-ink-faint{color:var(--app-text-faint)}.text-ink-muted,.text-ink-muted\/50{color:var(--app-text-muted)}@supports (color:color-mix(in lab,red,red)){.text-ink-muted\/50{color:color-mix(in oklab,var(--app-text-muted) 50%,transparent)}}.text-ink-secondary{color:var(--app-text-secondary)}.text-ink\/70{color:var(--app-text-primary)}@supports (color:color-mix(in lab,red,red)){.text-ink\/70{color:color-mix(in oklab,var(--app-text-primary) 70%,transparent)}}.text-slate-300{color:var(--color-slate-300)}.text-slate-400{color:var(--color-slate-400)}.text-slate-900{color:var(--color-slate-900)}.text-status-danger-text,.text-status-danger-text\/60{color:var(--status-danger-text)}@supports (color:color-mix(in lab,red,red)){.text-status-danger-text\/60{color:color-mix(in oklab,var(--status-danger-text) 60%,transparent)}}.text-status-danger-text\/70{color:var(--status-danger-text)}@supports (color:color-mix(in lab,red,red)){.text-status-danger-text\/70{color:color-mix(in oklab,var(--status-danger-text) 70%,transparent)}}.text-status-danger-text\/80{color:var(--status-danger-text)}@supports (color:color-mix(in lab,red,red)){.text-status-danger-text\/80{color:color-mix(in oklab,var(--status-danger-text) 80%,transparent)}}.text-status-danger-text\/90{color:var(--status-danger-text)}@supports (color:color-mix(in lab,red,red)){.text-status-danger-text\/90{color:color-mix(in oklab,var(--status-danger-text) 90%,transparent)}}.text-status-success-text{color:var(--status-success-text)}.text-status-warning-text{color:var(--status-warning-text)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.placeholder-ink-faint::placeholder{color:var(--app-text-faint)}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-90{opacity:.9}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_9999px_rgba\(0\,0\,0\,0\.45\)\]{--tw-shadow:0 0 0 9999px var(--tw-shadow-color,#00000073);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_6px_rgb\(0_0_0\/0\.35\)\]{--tw-shadow:0 2px 6px var(--tw-shadow-color,#00000059);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_1px_0_rgb\(255_255_255\/0\.12\)\]{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,#ffffff1f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_1px_0_rgb\(255_255_255\/0\.35\)\,0_8px_24px_-6px_rgb\(16_185_129\/0\.55\)\]{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,#ffffff59), 0 8px 24px -6px var(--tw-shadow-color,#10b9818c);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-app{--tw-ring-color:var(--app-bg)}.ring-chip-indigo-border\/40{--tw-ring-color:var(--chip-indigo-border)}@supports (color:color-mix(in lab,red,red)){.ring-chip-indigo-border\/40{--tw-ring-color:color-mix(in oklab, var(--chip-indigo-border) 40%, transparent)}}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter\!{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)!important}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-xs{--tw-backdrop-blur:blur(var(--blur-xs));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[filter\,box-shadow\,transform\]{transition-property:filter,box-shadow,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:text-white:is(:where(.group):hover *){color:var(--color-white)}.group-hover\:opacity-40:is(:where(.group):hover *){opacity:.4}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.selection\:bg-indigo-500 ::selection{background-color:var(--color-indigo-500)}.selection\:bg-indigo-500::selection{background-color:var(--color-indigo-500)}.selection\:text-white ::selection{color:var(--color-white)}.selection\:text-white::selection{color:var(--color-white)}.placeholder\:text-ink-faint::placeholder{color:var(--app-text-faint)}.first\:mt-0:first-child{margin-top:0}.last\:mb-0:last-child{margin-bottom:0}@media(hover:hover){.hover\:-translate-y-px:hover{--tw-translate-y:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:border-chip-indigo-border:hover{border-color:var(--chip-indigo-border)}.hover\:border-indigo-400:hover{border-color:var(--color-indigo-400)}.hover\:border-indigo-500:hover{border-color:var(--color-indigo-500)}.hover\:border-status-warning-border:hover{border-color:var(--status-warning-border)}.hover\:bg-chip-indigo-bg\/40:hover{background-color:var(--chip-indigo-bg)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-chip-indigo-bg\/40:hover{background-color:color-mix(in oklab,var(--chip-indigo-bg) 40%,transparent)}}.hover\:bg-elevated:hover,.hover\:bg-elevated\/50:hover{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-elevated\/50:hover{background-color:color-mix(in oklab,var(--app-elevated) 50%,transparent)}}.hover\:bg-elevated\/60:hover{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-elevated\/60:hover{background-color:color-mix(in oklab,var(--app-elevated) 60%,transparent)}}.hover\:bg-elevated\/70:hover{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-elevated\/70:hover{background-color:color-mix(in oklab,var(--app-elevated) 70%,transparent)}}.hover\:bg-elevated\/80:hover{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-elevated\/80:hover{background-color:color-mix(in oklab,var(--app-elevated) 80%,transparent)}}.hover\:bg-emerald-500:hover{background-color:var(--color-emerald-500)}.hover\:bg-hover-surface:hover{background-color:var(--app-hover)}.hover\:bg-indigo-500:hover{background-color:var(--color-indigo-500)}.hover\:bg-indigo-600:hover{background-color:var(--color-indigo-600)}.hover\:bg-status-danger-bg:hover,.hover\:bg-status-danger-bg\/60:hover{background-color:var(--status-danger-bg)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-status-danger-bg\/60:hover{background-color:color-mix(in oklab,var(--status-danger-bg) 60%,transparent)}}.hover\:bg-status-warning-bg:hover,.hover\:bg-status-warning-bg\/40:hover{background-color:var(--status-warning-bg)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-status-warning-bg\/40:hover{background-color:color-mix(in oklab,var(--status-warning-bg) 40%,transparent)}}.hover\:bg-surface:hover{background-color:var(--app-surface)}.hover\:bg-surface-strong:hover{background-color:var(--app-glass-strong)}.hover\:bg-white:hover{background-color:var(--color-white)}.hover\:text-chip-indigo-text:hover{color:var(--chip-indigo-text)}.hover\:text-ink:hover{color:var(--app-text-primary)}.hover\:text-status-danger-text:hover{color:var(--status-danger-text)}.hover\:text-status-warning-text:hover{color:var(--status-warning-text)}.hover\:text-white:hover{color:var(--color-white)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-40:hover{opacity:.4}.hover\:shadow-\[inset_0_1px_0_rgb\(255_255_255\/0\.35\)\,0_12px_30px_-6px_rgb\(16_185_129\/0\.7\)\]:hover{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,#ffffff59), 0 12px 30px -6px var(--tw-shadow-color,#10b981b3);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:brightness-95:hover{--tw-brightness:brightness(95%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.hover\:brightness-110:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-indigo-500:focus{--tw-ring-color:var(--color-indigo-500)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:z-10:focus-visible{z-index:10}.focus-visible\:border-indigo-400:focus-visible{border-color:var(--color-indigo-400)}.focus-visible\:border-indigo-500:focus-visible{border-color:var(--color-indigo-500)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-emerald-400:focus-visible{--tw-ring-color:var(--color-emerald-400)}.focus-visible\:ring-indigo-400:focus-visible{--tw-ring-color:var(--color-indigo-400)}.focus-visible\:ring-indigo-500:focus-visible{--tw-ring-color:var(--color-indigo-500)}.focus-visible\:ring-indigo-500\/30:focus-visible{--tw-ring-color:#625fff4d}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-indigo-500\/30:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 30%, transparent)}}.focus-visible\:ring-status-danger-border:focus-visible{--tw-ring-color:var(--status-danger-border)}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:ring-offset-app:focus-visible{--tw-ring-offset-color:var(--app-bg)}.focus-visible\:outline:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:outline-offset-\[-2px\]:focus-visible{outline-offset:-2px}.focus-visible\:outline-indigo-500:focus-visible{outline-color:var(--color-indigo-500)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-inset:focus-visible{--tw-ring-inset:inset}.active\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(hover:hover){.disabled\:hover\:translate-y-0:disabled:hover{--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.disabled\:hover\:text-ink-muted:disabled:hover{color:var(--app-text-muted)}.disabled\:hover\:shadow-\[inset_0_1px_0_rgb\(255_255_255\/0\.35\)\,0_8px_24px_-6px_rgb\(16_185_129\/0\.55\)\]:disabled:hover{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,#ffffff59), 0 8px 24px -6px var(--tw-shadow-color,#10b9818c);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.disabled\:hover\:brightness-100:disabled:hover{--tw-brightness:brightness(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}@media(prefers-reduced-motion:reduce){.motion-reduce\:animate-none{animation:none}}@media(min-width:40rem){.sm\:inline{display:inline}.sm\:basis-auto{flex-basis:auto}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.sm\:rounded-2xl{border-radius:var(--radius-2xl)}.sm\:rounded-xl{border-radius:var(--radius-xl)}.sm\:p-1\.5{padding:calc(var(--spacing) * 1.5)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:px-3{padding-inline:calc(var(--spacing) * 3)}.sm\:px-5{padding-inline:calc(var(--spacing) * 5)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}.sm\:py-3{padding-block:calc(var(--spacing) * 3)}}@media(min-width:64rem){.lg\:flex{display:flex}}.\[\&_code\]\:bg-transparent code{background-color:#0000}.\[\&_code\]\:px-0 code{padding-inline:0}.\[\&_code\]\:py-0 code{padding-block:0}.\[\&_code\]\:text-inherit code{color:inherit}.animate-modal-in{animation:.15s cubic-bezier(.2,.8,.2,1) modal-in}.animate-overlay-in{animation:.15s ease-out overlay-in}.animate-toast-in{animation:.12s ease-out toast-in}}:where(button,[role=button],input,select,textarea,a,summary,video[tabindex],[tabindex]):focus-visible{outline:2px solid var(--color-indigo-500,#6366f1);outline-offset:2px}:root{color-scheme:light dark;--z-combobox-list:60;--z-syntax-helper:65;--z-context-menu:70;--z-modal:80;--z-drop-overlay:85;--z-toast:90;--z-tooltip:100}:root,[data-theme=dark]{--app-bg:#020617;--app-surface:#0f172a;--app-elevated:#1e293b;--app-hover:#334155;--app-border:#334155;--app-frame-border:#94a3b84d;--app-text-primary:#f8fafc;--app-text-secondary:#cbd5e1;--app-text-muted:#94a3b8;--app-text-faint:#94a3b8;--app-glass:#0f172a99;--app-glass-strong:#020617e6;--app-glass-panel:#0f172ac7;--app-glass-panel-strong:#020617e0;--app-glass-highlight:#ffffff17;--app-panel-shadow:0 24px 60px -12px #0206178c;color-scheme:dark;--chip-indigo-bg:#6366f140;--chip-indigo-border:#818cf880;--chip-indigo-text:#c7d2fe;--chip-purple-bg:#a855f740;--chip-purple-border:#c084fc80;--chip-purple-text:#f3e8ff;--chip-fuchsia-bg:#c026d340;--chip-fuchsia-border:#e879f980;--chip-fuchsia-text:#f5d0fe;--chip-sky-bg:#0ea5e940;--chip-sky-border:#38bdf880;--chip-sky-text:#bae6fd;--chip-amber-bg:#f59e0b40;--chip-amber-border:#fbbf2480;--chip-amber-text:#fde68a;--status-success-bg:#10b98140;--status-success-border:#34d39980;--status-success-text:#a7f3d0;--status-warning-bg:#f59e0b40;--status-warning-border:#fbbf2480;--status-warning-text:#fde68a;--status-danger-bg:#f43f5e40;--status-danger-border:#fb718580;--status-danger-text:#fecdd3}[data-theme=light]{--chip-indigo-bg:#e0e7ff;--chip-indigo-border:#a5b4fc;--chip-indigo-text:#3730a3;--chip-purple-bg:#f3e8ff;--chip-purple-border:#d8b4fe;--chip-purple-text:#6b21a8;--chip-fuchsia-bg:#fae8ff;--chip-fuchsia-border:#f0abfc;--chip-fuchsia-text:#86198f;--chip-sky-bg:#e0f2fe;--chip-sky-border:#7dd3fc;--chip-sky-text:#0369a1;--chip-amber-bg:#fef3c7;--chip-amber-border:#fcd34d;--chip-amber-text:#92400e;--status-success-bg:#d1fae5;--status-success-border:#6ee7b7;--status-success-text:#065f46;--status-warning-bg:#fef3c7;--status-warning-border:#fcd34d;--status-warning-text:#92400e;--status-danger-bg:#ffe4e6;--status-danger-border:#fda4af;--status-danger-text:#9f1239;--app-bg:#f8fafc;--app-surface:#fff;--app-elevated:#f1f5f9;--app-hover:#e2e8f0;--app-border:#cbd5e1;--app-frame-border:#0f172a29;--app-text-primary:#0f172a;--app-text-secondary:#334155;--app-text-muted:#475569;--app-text-faint:#475569;--app-glass:#ffffffb3;--app-glass-strong:#f8fafcf2;--app-glass-panel:#fffc;--app-glass-panel-strong:#f8fafceb;--app-glass-highlight:#ffffffe6;--app-panel-shadow:0 24px 60px -18px #0f172a47;color-scheme:light}body{background-color:var(--app-bg);min-height:100vh;color:var(--app-text-primary);margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;transition:background-color .2s,color .2s}@media(prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@keyframes modal-in{0%{opacity:0;transform:translateY(4px)scale(.995)}to{opacity:1;transform:none}}@keyframes overlay-in{0%{opacity:0}to{opacity:1}}@keyframes toast-in{0%{opacity:0;translate:-50% calc(6px - 50%)}to{opacity:1;translate:-50% -50%}}*{scrollbar-color:var(--app-border) transparent;scrollbar-width:thin}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background-color:var(--app-border);background-clip:content-box;border:2px solid #0000;border-radius:9999px}::-webkit-scrollbar-thumb:hover{background-color:var(--app-text-faint)}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}} diff --git a/src/profiles/web/dist/assets/index-UtzA6W35.css b/src/profiles/web/dist/assets/index-UtzA6W35.css new file mode 100644 index 0000000..7f8901f --- /dev/null +++ b/src/profiles/web/dist/assets/index-UtzA6W35.css @@ -0,0 +1 @@ +/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-outline-style:solid;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-800:oklch(43.2% .095 166.913);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-900:oklch(20.8% .042 265.755);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-4xl:56rem;--container-5xl:64rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-xs:4px;--blur-sm:8px;--blur-md:12px;--blur-xl:24px;--aspect-video:16 / 9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components{.glass-panel{background:var(--app-glass-panel);-webkit-backdrop-filter:blur(24px)saturate(160%);backdrop-filter:blur(24px)saturate(160%);box-shadow:var(--app-panel-shadow),inset 0 1px 0 var(--app-glass-highlight)}.glass-panel-strong{background:var(--app-glass-panel-strong);-webkit-backdrop-filter:blur(28px)saturate(180%);backdrop-filter:blur(28px)saturate(180%);box-shadow:var(--app-panel-shadow),inset 0 1px 0 var(--app-glass-highlight)}.btn{justify-content:center;align-items:center;gap:calc(var(--spacing) * 1.5);border-radius:var(--radius-md);border-style:var(--tw-border-style);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));border-width:1px;display:inline-flex}.btn:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:#625fffb3}@supports (color:color-mix(in lab,red,red)){.btn:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 70%, transparent)}}.btn:focus-visible{--tw-outline-style:none;outline-style:none}.btn:disabled{cursor:not-allowed;opacity:.4}.btn-primary{background-color:var(--color-indigo-600);color:var(--color-white);border-color:#0000}@media(hover:hover){.btn-primary:hover{background-color:var(--color-indigo-500)}}.btn-secondary{border-color:var(--app-border);background-color:var(--app-elevated);color:var(--app-text-secondary)}@media(hover:hover){.btn-secondary:hover{border-color:var(--color-indigo-500);color:var(--app-text-primary)}.btn-chip:hover{--tw-brightness:brightness(95%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.btn-chip:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:#625fffb3}@supports (color:color-mix(in lab,red,red)){.btn-chip:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 70%, transparent)}}.btn-chip:focus-visible{--tw-outline-style:none;outline-style:none}.btn-chip:disabled{cursor:not-allowed;opacity:.4}.focus-ring:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:#625fffb3}@supports (color:color-mix(in lab,red,red)){.focus-ring:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 70%, transparent)}}.focus-ring:focus-visible{--tw-outline-style:none;outline-style:none}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{inset-block:0}.-top-1{top:calc(var(--spacing) * -1)}.top-0{top:0}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-full{top:100%}.-right-0\.5{right:calc(var(--spacing) * -.5)}.-right-1{right:calc(var(--spacing) * -1)}.right-0{right:0}.right-2{right:calc(var(--spacing) * 2)}.-bottom-0\.5{bottom:calc(var(--spacing) * -.5)}.-bottom-1{bottom:calc(var(--spacing) * -1)}.bottom-0{bottom:0}.bottom-2{bottom:calc(var(--spacing) * 2)}.-left-1{left:calc(var(--spacing) * -1)}.left-0{left:0}.left-1\/2{left:50%}.left-2\.5{left:calc(var(--spacing) * 2.5)}.left-3{left:calc(var(--spacing) * 3)}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-\[calc\(var\(--z-context-menu\)-1\)\]{z-index:calc(var(--z-context-menu) - 1)}.z-\[var\(--z-combobox-list\)\]{z-index:var(--z-combobox-list)}.z-\[var\(--z-context-menu\)\]{z-index:var(--z-context-menu)}.z-\[var\(--z-drop-overlay\)\]{z-index:var(--z-drop-overlay)}.z-\[var\(--z-modal\)\]{z-index:var(--z-modal)}.z-\[var\(--z-syntax-helper\)\]{z-index:var(--z-syntax-helper)}.z-\[var\(--z-toast\)\]{z-index:var(--z-toast)}.z-\[var\(--z-tooltip\)\]{z-index:var(--z-tooltip)}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:var(--spacing)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.my-1\.5{margin-block:calc(var(--spacing) * 1.5)}.my-2{margin-block:calc(var(--spacing) * 2)}.my-3{margin-block:calc(var(--spacing) * 3)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mr-1\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-auto{margin-right:auto}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:var(--spacing)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.ml-1\.5{margin-left:calc(var(--spacing) * 1.5)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-video{aspect-ratio:var(--aspect-video)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-48{height:calc(var(--spacing) * 48)}.h-\[80vh\]{height:80vh}.h-\[min\(84dvh\,760px\)\]{height:min(84dvh,760px)}.h-dvh{height:100dvh}.h-full{height:100%}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-\[60vh\]{max-height:60vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(100dvh-1\.5rem\)\]{max-height:calc(100dvh - 1.5rem)}.max-h-\[calc\(100dvh-16px\)\]{max-height:calc(100dvh - 16px)}.min-h-0{min-height:0}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-10{min-height:calc(var(--spacing) * 10)}.min-h-36{min-height:calc(var(--spacing) * 36)}.min-h-\[24px\]{min-height:24px}.min-h-\[44px\]{min-height:44px}.min-h-screen{min-height:100vh}.w-1\/3{width:33.3333%}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-44{width:calc(var(--spacing) * 44)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-72{width:calc(var(--spacing) * 72)}.w-96{width:calc(var(--spacing) * 96)}.w-\[52px\]{width:52px}.w-\[138px\]{width:138px}.w-\[150px\]{width:150px}.w-\[400px\]{width:400px}.w-\[420px\]{width:420px}.w-\[450px\]{width:450px}.w-\[clamp\(560px\,85vw\,1500px\)\]{width:clamp(560px,85vw,1500px)}.w-\[min\(94vw\,960px\)\]{width:min(94vw,960px)}.w-full{width:100%}.w-max{width:max-content}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-\[calc\(100vw-16px\)\]{max-width:calc(100vw - 16px)}.max-w-\[min\(70vw\,560px\)\]{max-width:min(70vw,560px)}.max-w-\[min\(80vw\,640px\)\]{max-width:min(80vw,640px)}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-48{min-width:calc(var(--spacing) * 48)}.min-w-\[100px\]{min-width:100px}.min-w-\[220px\]{min-width:220px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.basis-64{flex-basis:calc(var(--spacing) * 64)}.basis-full{flex-basis:100%}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize{resize:both}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-l-md{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.rounded-r-md{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-2{border-top-style:var(--tw-border-style);border-top-width:2px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-r-2{border-right-style:var(--tw-border-style);border-right-width:2px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-0{border-left-style:var(--tw-border-style);border-left-width:0}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-chip-amber-border{border-color:var(--chip-amber-border)}.border-chip-fuchsia-border{border-color:var(--chip-fuchsia-border)}.border-chip-indigo-border,.border-chip-indigo-border\/50{border-color:var(--chip-indigo-border)}@supports (color:color-mix(in lab,red,red)){.border-chip-indigo-border\/50{border-color:color-mix(in oklab,var(--chip-indigo-border) 50%,transparent)}}.border-chip-purple-border,.border-chip-purple-border\/50{border-color:var(--chip-purple-border)}@supports (color:color-mix(in lab,red,red)){.border-chip-purple-border\/50{border-color:color-mix(in oklab,var(--chip-purple-border) 50%,transparent)}}.border-chip-sky-border{border-color:var(--chip-sky-border)}.border-emerald-300\/50{border-color:#5ee9b580}@supports (color:color-mix(in lab,red,red)){.border-emerald-300\/50{border-color:color-mix(in oklab,var(--color-emerald-300) 50%,transparent)}}.border-emerald-500\/30{border-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/30{border-color:color-mix(in oklab,var(--color-emerald-500) 30%,transparent)}}.border-frame-line{border-color:var(--app-frame-border)}.border-indigo-400{border-color:var(--color-indigo-400)}.border-indigo-400\/80{border-color:#7d87ffcc}@supports (color:color-mix(in lab,red,red)){.border-indigo-400\/80{border-color:color-mix(in oklab,var(--color-indigo-400) 80%,transparent)}}.border-indigo-600{border-color:var(--color-indigo-600)}.border-line,.border-line\/40{border-color:var(--app-border)}@supports (color:color-mix(in lab,red,red)){.border-line\/40{border-color:color-mix(in oklab,var(--app-border) 40%,transparent)}}.border-line\/60{border-color:var(--app-border)}@supports (color:color-mix(in lab,red,red)){.border-line\/60{border-color:color-mix(in oklab,var(--app-border) 60%,transparent)}}.border-slate-500\/30{border-color:#62748e4d}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/30{border-color:color-mix(in oklab,var(--color-slate-500) 30%,transparent)}}.border-status-danger-border{border-color:var(--status-danger-border)}.border-status-success-border{border-color:var(--status-success-border)}.border-status-warning-border{border-color:var(--status-warning-border)}.border-transparent{border-color:#0000}.border-t-transparent{border-top-color:#0000}.border-l-transparent{border-left-color:#0000}.bg-app,.bg-app\/90{background-color:var(--app-bg)}@supports (color:color-mix(in lab,red,red)){.bg-app\/90{background-color:color-mix(in oklab,var(--app-bg) 90%,transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\/20{background-color:color-mix(in oklab,var(--color-black) 20%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-black\/65{background-color:#000000a6}@supports (color:color-mix(in lab,red,red)){.bg-black\/65{background-color:color-mix(in oklab,var(--color-black) 65%,transparent)}}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.bg-black\/70{background-color:color-mix(in oklab,var(--color-black) 70%,transparent)}}.bg-chip-amber-bg{background-color:var(--chip-amber-bg)}.bg-chip-fuchsia-bg{background-color:var(--chip-fuchsia-bg)}.bg-chip-indigo-bg,.bg-chip-indigo-bg\/20{background-color:var(--chip-indigo-bg)}@supports (color:color-mix(in lab,red,red)){.bg-chip-indigo-bg\/20{background-color:color-mix(in oklab,var(--chip-indigo-bg) 20%,transparent)}}.bg-chip-purple-bg{background-color:var(--chip-purple-bg)}.bg-chip-sky-bg{background-color:var(--chip-sky-bg)}.bg-elevated,.bg-elevated\/30{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-elevated\/30{background-color:color-mix(in oklab,var(--app-elevated) 30%,transparent)}}.bg-elevated\/50{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-elevated\/50{background-color:color-mix(in oklab,var(--app-elevated) 50%,transparent)}}.bg-elevated\/60{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-elevated\/60{background-color:color-mix(in oklab,var(--app-elevated) 60%,transparent)}}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-600{background-color:var(--color-emerald-600)}.bg-emerald-800\/60{background-color:#005f4699}@supports (color:color-mix(in lab,red,red)){.bg-emerald-800\/60{background-color:color-mix(in oklab,var(--color-emerald-800) 60%,transparent)}}.bg-indigo-500\/5{background-color:#625fff0d}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/5{background-color:color-mix(in oklab,var(--color-indigo-500) 5%,transparent)}}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-ink-faint{background-color:var(--app-text-faint)}.bg-slate-600\/20{background-color:#45556c33}@supports (color:color-mix(in lab,red,red)){.bg-slate-600\/20{background-color:color-mix(in oklab,var(--color-slate-600) 20%,transparent)}}.bg-status-danger-bg,.bg-status-danger-bg\/30{background-color:var(--status-danger-bg)}@supports (color:color-mix(in lab,red,red)){.bg-status-danger-bg\/30{background-color:color-mix(in oklab,var(--status-danger-bg) 30%,transparent)}}.bg-status-danger-bg\/40{background-color:var(--status-danger-bg)}@supports (color:color-mix(in lab,red,red)){.bg-status-danger-bg\/40{background-color:color-mix(in oklab,var(--status-danger-bg) 40%,transparent)}}.bg-status-success-bg{background-color:var(--status-success-bg)}.bg-status-warning-bg{background-color:var(--status-warning-bg)}.bg-surface{background-color:var(--app-surface)}.bg-surface-glass{background-color:var(--app-glass)}.bg-surface-strong,.bg-surface-strong\/20{background-color:var(--app-glass-strong)}@supports (color:color-mix(in lab,red,red)){.bg-surface-strong\/20{background-color:color-mix(in oklab,var(--app-glass-strong) 20%,transparent)}}.bg-surface-strong\/30{background-color:var(--app-glass-strong)}@supports (color:color-mix(in lab,red,red)){.bg-surface-strong\/30{background-color:color-mix(in oklab,var(--app-glass-strong) 30%,transparent)}}.bg-surface\/50{background-color:var(--app-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/50{background-color:color-mix(in oklab,var(--app-surface) 50%,transparent)}}.bg-surface\/60{background-color:var(--app-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/60{background-color:color-mix(in oklab,var(--app-surface) 60%,transparent)}}.bg-white{background-color:var(--color-white)}.bg-white\/90{background-color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.bg-white\/90{background-color:color-mix(in oklab,var(--color-white) 90%,transparent)}}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-chip-indigo-bg{--tw-gradient-from:var(--chip-indigo-bg);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-400\/90{--tw-gradient-from:#00d294e6}@supports (color:color-mix(in lab,red,red)){.from-emerald-400\/90{--tw-gradient-from:color-mix(in oklab, var(--color-emerald-400) 90%, transparent)}}.from-emerald-400\/90{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-chip-purple-bg{--tw-gradient-to:var(--chip-purple-bg);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-emerald-600\/90{--tw-gradient-to:#009767e6}@supports (color:color-mix(in lab,red,red)){.to-emerald-600\/90{--tw-gradient-to:color-mix(in oklab, var(--color-emerald-600) 90%, transparent)}}.to-emerald-600\/90{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.fill-current{fill:currentColor}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-px{padding-block:1px}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1{padding-right:var(--spacing)}.pr-2\.5{padding-right:calc(var(--spacing) * 2.5)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-5{padding-left:calc(var(--spacing) * 5)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.align-\[1px\]{vertical-align:1px}.align-top{vertical-align:top}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-chip-amber-text{color:var(--chip-amber-text)}.text-chip-fuchsia-text{color:var(--chip-fuchsia-text)}.text-chip-indigo-text{color:var(--chip-indigo-text)}.text-chip-purple-text{color:var(--chip-purple-text)}.text-chip-sky-text{color:var(--chip-sky-text)}.text-emerald-200{color:var(--color-emerald-200)}.text-ink{color:var(--app-text-primary)}.text-ink-faint{color:var(--app-text-faint)}.text-ink-muted,.text-ink-muted\/50{color:var(--app-text-muted)}@supports (color:color-mix(in lab,red,red)){.text-ink-muted\/50{color:color-mix(in oklab,var(--app-text-muted) 50%,transparent)}}.text-ink-secondary{color:var(--app-text-secondary)}.text-ink\/70{color:var(--app-text-primary)}@supports (color:color-mix(in lab,red,red)){.text-ink\/70{color:color-mix(in oklab,var(--app-text-primary) 70%,transparent)}}.text-slate-300{color:var(--color-slate-300)}.text-slate-400{color:var(--color-slate-400)}.text-slate-900{color:var(--color-slate-900)}.text-status-danger-text,.text-status-danger-text\/60{color:var(--status-danger-text)}@supports (color:color-mix(in lab,red,red)){.text-status-danger-text\/60{color:color-mix(in oklab,var(--status-danger-text) 60%,transparent)}}.text-status-danger-text\/70{color:var(--status-danger-text)}@supports (color:color-mix(in lab,red,red)){.text-status-danger-text\/70{color:color-mix(in oklab,var(--status-danger-text) 70%,transparent)}}.text-status-danger-text\/80{color:var(--status-danger-text)}@supports (color:color-mix(in lab,red,red)){.text-status-danger-text\/80{color:color-mix(in oklab,var(--status-danger-text) 80%,transparent)}}.text-status-danger-text\/90{color:var(--status-danger-text)}@supports (color:color-mix(in lab,red,red)){.text-status-danger-text\/90{color:color-mix(in oklab,var(--status-danger-text) 90%,transparent)}}.text-status-success-text{color:var(--status-success-text)}.text-status-warning-text{color:var(--status-warning-text)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.placeholder-ink-faint::placeholder{color:var(--app-text-faint)}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-90{opacity:.9}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_9999px_rgba\(0\,0\,0\,0\.45\)\]{--tw-shadow:0 0 0 9999px var(--tw-shadow-color,#00000073);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_6px_rgb\(0_0_0\/0\.35\)\]{--tw-shadow:0 2px 6px var(--tw-shadow-color,#00000059);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_1px_0_rgb\(255_255_255\/0\.12\)\]{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,#ffffff1f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_1px_0_rgb\(255_255_255\/0\.35\)\,0_8px_24px_-6px_rgb\(16_185_129\/0\.55\)\]{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,#ffffff59), 0 8px 24px -6px var(--tw-shadow-color,#10b9818c);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-app{--tw-ring-color:var(--app-bg)}.ring-chip-indigo-border\/40{--tw-ring-color:var(--chip-indigo-border)}@supports (color:color-mix(in lab,red,red)){.ring-chip-indigo-border\/40{--tw-ring-color:color-mix(in oklab, var(--chip-indigo-border) 40%, transparent)}}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter\!{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)!important}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-xs{--tw-backdrop-blur:blur(var(--blur-xs));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[filter\,box-shadow\,transform\]{transition-property:filter,box-shadow,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:text-white:is(:where(.group):hover *){color:var(--color-white)}.group-hover\:opacity-40:is(:where(.group):hover *){opacity:.4}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.selection\:bg-indigo-500 ::selection{background-color:var(--color-indigo-500)}.selection\:bg-indigo-500::selection{background-color:var(--color-indigo-500)}.selection\:text-white ::selection{color:var(--color-white)}.selection\:text-white::selection{color:var(--color-white)}.placeholder\:text-ink-faint::placeholder{color:var(--app-text-faint)}.first\:mt-0:first-child{margin-top:0}.last\:mb-0:last-child{margin-bottom:0}@media(hover:hover){.hover\:-translate-y-px:hover{--tw-translate-y:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:border-chip-indigo-border:hover{border-color:var(--chip-indigo-border)}.hover\:border-indigo-400:hover{border-color:var(--color-indigo-400)}.hover\:border-indigo-500:hover{border-color:var(--color-indigo-500)}.hover\:border-status-warning-border:hover{border-color:var(--status-warning-border)}.hover\:bg-chip-indigo-bg\/40:hover{background-color:var(--chip-indigo-bg)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-chip-indigo-bg\/40:hover{background-color:color-mix(in oklab,var(--chip-indigo-bg) 40%,transparent)}}.hover\:bg-elevated:hover,.hover\:bg-elevated\/50:hover{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-elevated\/50:hover{background-color:color-mix(in oklab,var(--app-elevated) 50%,transparent)}}.hover\:bg-elevated\/60:hover{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-elevated\/60:hover{background-color:color-mix(in oklab,var(--app-elevated) 60%,transparent)}}.hover\:bg-elevated\/70:hover{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-elevated\/70:hover{background-color:color-mix(in oklab,var(--app-elevated) 70%,transparent)}}.hover\:bg-elevated\/80:hover{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-elevated\/80:hover{background-color:color-mix(in oklab,var(--app-elevated) 80%,transparent)}}.hover\:bg-emerald-500:hover{background-color:var(--color-emerald-500)}.hover\:bg-hover-surface:hover{background-color:var(--app-hover)}.hover\:bg-indigo-500:hover{background-color:var(--color-indigo-500)}.hover\:bg-indigo-600:hover{background-color:var(--color-indigo-600)}.hover\:bg-status-danger-bg:hover,.hover\:bg-status-danger-bg\/60:hover{background-color:var(--status-danger-bg)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-status-danger-bg\/60:hover{background-color:color-mix(in oklab,var(--status-danger-bg) 60%,transparent)}}.hover\:bg-status-warning-bg:hover,.hover\:bg-status-warning-bg\/40:hover{background-color:var(--status-warning-bg)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-status-warning-bg\/40:hover{background-color:color-mix(in oklab,var(--status-warning-bg) 40%,transparent)}}.hover\:bg-surface:hover{background-color:var(--app-surface)}.hover\:bg-surface-strong:hover{background-color:var(--app-glass-strong)}.hover\:bg-white:hover{background-color:var(--color-white)}.hover\:text-chip-indigo-text:hover{color:var(--chip-indigo-text)}.hover\:text-ink:hover{color:var(--app-text-primary)}.hover\:text-status-danger-text:hover{color:var(--status-danger-text)}.hover\:text-status-warning-text:hover{color:var(--status-warning-text)}.hover\:text-white:hover{color:var(--color-white)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-40:hover{opacity:.4}.hover\:shadow-\[inset_0_1px_0_rgb\(255_255_255\/0\.35\)\,0_12px_30px_-6px_rgb\(16_185_129\/0\.7\)\]:hover{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,#ffffff59), 0 12px 30px -6px var(--tw-shadow-color,#10b981b3);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:brightness-95:hover{--tw-brightness:brightness(95%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.hover\:brightness-110:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-indigo-500:focus{--tw-ring-color:var(--color-indigo-500)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:z-10:focus-visible{z-index:10}.focus-visible\:border-indigo-400:focus-visible{border-color:var(--color-indigo-400)}.focus-visible\:border-indigo-500:focus-visible{border-color:var(--color-indigo-500)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-emerald-400:focus-visible{--tw-ring-color:var(--color-emerald-400)}.focus-visible\:ring-indigo-400:focus-visible{--tw-ring-color:var(--color-indigo-400)}.focus-visible\:ring-indigo-500:focus-visible{--tw-ring-color:var(--color-indigo-500)}.focus-visible\:ring-indigo-500\/30:focus-visible{--tw-ring-color:#625fff4d}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-indigo-500\/30:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 30%, transparent)}}.focus-visible\:ring-status-danger-border:focus-visible{--tw-ring-color:var(--status-danger-border)}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:ring-offset-app:focus-visible{--tw-ring-offset-color:var(--app-bg)}.focus-visible\:outline:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:outline-offset-\[-2px\]:focus-visible{outline-offset:-2px}.focus-visible\:outline-indigo-500:focus-visible{outline-color:var(--color-indigo-500)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-inset:focus-visible{--tw-ring-inset:inset}.active\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(hover:hover){.disabled\:hover\:translate-y-0:disabled:hover{--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.disabled\:hover\:text-ink-muted:disabled:hover{color:var(--app-text-muted)}.disabled\:hover\:shadow-\[inset_0_1px_0_rgb\(255_255_255\/0\.35\)\,0_8px_24px_-6px_rgb\(16_185_129\/0\.55\)\]:disabled:hover{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,#ffffff59), 0 8px 24px -6px var(--tw-shadow-color,#10b9818c);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.disabled\:hover\:brightness-100:disabled:hover{--tw-brightness:brightness(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}@media(prefers-reduced-motion:reduce){.motion-reduce\:animate-none{animation:none}}@media(min-width:40rem){.sm\:inline{display:inline}.sm\:basis-auto{flex-basis:auto}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.sm\:rounded-2xl{border-radius:var(--radius-2xl)}.sm\:rounded-xl{border-radius:var(--radius-xl)}.sm\:p-1\.5{padding:calc(var(--spacing) * 1.5)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:px-3{padding-inline:calc(var(--spacing) * 3)}.sm\:px-5{padding-inline:calc(var(--spacing) * 5)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}.sm\:py-3{padding-block:calc(var(--spacing) * 3)}}@media(min-width:64rem){.lg\:flex{display:flex}}.\[\&_code\]\:bg-transparent code{background-color:#0000}.\[\&_code\]\:px-0 code{padding-inline:0}.\[\&_code\]\:py-0 code{padding-block:0}.\[\&_code\]\:text-inherit code{color:inherit}.animate-modal-in{animation:.15s cubic-bezier(.2,.8,.2,1) modal-in}.animate-overlay-in{animation:.15s ease-out overlay-in}.animate-toast-in{animation:.12s ease-out toast-in}}:where(button,[role=button],input,select,textarea,a,summary,video[tabindex],[tabindex]):focus-visible{outline:2px solid var(--color-indigo-500,#6366f1);outline-offset:2px}:root{color-scheme:light dark;--z-combobox-list:60;--z-syntax-helper:65;--z-context-menu:70;--z-modal:80;--z-drop-overlay:85;--z-toast:90;--z-tooltip:100}:root,[data-theme=dark]{--app-bg:#020617;--app-surface:#0f172a;--app-elevated:#1e293b;--app-hover:#334155;--app-border:#334155;--app-frame-border:#94a3b84d;--app-text-primary:#f8fafc;--app-text-secondary:#cbd5e1;--app-text-muted:#94a3b8;--app-text-faint:#94a3b8;--app-glass:#0f172a99;--app-glass-strong:#020617e6;--app-glass-panel:#0f172ac7;--app-glass-panel-strong:#020617e0;--app-glass-highlight:#ffffff17;--app-panel-shadow:0 24px 60px -12px #0206178c;color-scheme:dark;--chip-indigo-bg:#6366f140;--chip-indigo-border:#818cf880;--chip-indigo-text:#c7d2fe;--chip-purple-bg:#a855f740;--chip-purple-border:#c084fc80;--chip-purple-text:#f3e8ff;--chip-fuchsia-bg:#c026d340;--chip-fuchsia-border:#e879f980;--chip-fuchsia-text:#f5d0fe;--chip-sky-bg:#0ea5e940;--chip-sky-border:#38bdf880;--chip-sky-text:#bae6fd;--chip-amber-bg:#f59e0b40;--chip-amber-border:#fbbf2480;--chip-amber-text:#fde68a;--status-success-bg:#10b98140;--status-success-border:#34d39980;--status-success-text:#a7f3d0;--status-warning-bg:#f59e0b40;--status-warning-border:#fbbf2480;--status-warning-text:#fde68a;--status-danger-bg:#f43f5e40;--status-danger-border:#fb718580;--status-danger-text:#fecdd3}[data-theme=light]{--chip-indigo-bg:#e0e7ff;--chip-indigo-border:#a5b4fc;--chip-indigo-text:#3730a3;--chip-purple-bg:#f3e8ff;--chip-purple-border:#d8b4fe;--chip-purple-text:#6b21a8;--chip-fuchsia-bg:#fae8ff;--chip-fuchsia-border:#f0abfc;--chip-fuchsia-text:#86198f;--chip-sky-bg:#e0f2fe;--chip-sky-border:#7dd3fc;--chip-sky-text:#0369a1;--chip-amber-bg:#fef3c7;--chip-amber-border:#fcd34d;--chip-amber-text:#92400e;--status-success-bg:#d1fae5;--status-success-border:#6ee7b7;--status-success-text:#065f46;--status-warning-bg:#fef3c7;--status-warning-border:#fcd34d;--status-warning-text:#92400e;--status-danger-bg:#ffe4e6;--status-danger-border:#fda4af;--status-danger-text:#9f1239;--app-bg:#f8fafc;--app-surface:#fff;--app-elevated:#f1f5f9;--app-hover:#e2e8f0;--app-border:#cbd5e1;--app-frame-border:#0f172a29;--app-text-primary:#0f172a;--app-text-secondary:#334155;--app-text-muted:#475569;--app-text-faint:#475569;--app-glass:#ffffffb3;--app-glass-strong:#f8fafcf2;--app-glass-panel:#fffc;--app-glass-panel-strong:#f8fafceb;--app-glass-highlight:#ffffffe6;--app-panel-shadow:0 24px 60px -18px #0f172a47;color-scheme:light}body{background-color:var(--app-bg);min-height:100vh;color:var(--app-text-primary);margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;transition:background-color .2s,color .2s}@media(prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@keyframes modal-in{0%{opacity:0;transform:translateY(4px)scale(.995)}to{opacity:1;transform:none}}@keyframes overlay-in{0%{opacity:0}to{opacity:1}}@keyframes toast-in{0%{opacity:0;translate:-50% calc(6px - 50%)}to{opacity:1;translate:-50% -50%}}*{scrollbar-color:var(--app-border) transparent;scrollbar-width:thin}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background-color:var(--app-border);background-clip:content-box;border:2px solid #0000;border-radius:9999px}::-webkit-scrollbar-thumb:hover{background-color:var(--app-text-faint)}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}} diff --git a/src/profiles/web/dist/index.html b/src/profiles/web/dist/index.html index 5f7bac6..7851e3e 100644 --- a/src/profiles/web/dist/index.html +++ b/src/profiles/web/dist/index.html @@ -5,8 +5,8 @@ ProFiles - - + +
diff --git a/src/profiles/web/dist/sw.js b/src/profiles/web/dist/sw.js index 57fa4c5..37961b7 100644 --- a/src/profiles/web/dist/sw.js +++ b/src/profiles/web/dist/sw.js @@ -1 +1 @@ -if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const l=e=>i(e,t),d={module:{uri:t},exports:o,require:l};s[t]=Promise.all(n.map(e=>d[e]||l(e))).then(e=>(r(...e),o))}}define(["./workbox-9c191d2f"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"a3a08a8e4f4ddd06111646ea79a742bf"},{url:"assets/index-DlrIRth4.css",revision:null},{url:"assets/index-B7u9N9je.js",revision:null},{url:"manifest.webmanifest",revision:"5a42ebe8b55b07b5831cbbddda834829"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}); +if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,t)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let o={};const l=e=>i(e,r),d={module:{uri:r},exports:o,require:l};s[r]=Promise.all(n.map(e=>d[e]||l(e))).then(e=>(t(...e),o))}}define(["./workbox-9c191d2f"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"8ea06e474299b5f13e7375585fce931d"},{url:"assets/index-UtzA6W35.css",revision:null},{url:"assets/index-DF2VzIlA.js",revision:null},{url:"manifest.webmanifest",revision:"5a42ebe8b55b07b5831cbbddda834829"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}); diff --git a/src/profiles/web/src/App.tsx b/src/profiles/web/src/App.tsx index 1f20f51..81026e0 100644 --- a/src/profiles/web/src/App.tsx +++ b/src/profiles/web/src/App.tsx @@ -47,6 +47,7 @@ import { StatusBar } from "./components/StatusBar"; import { TimerModal } from "./components/TimerModal"; import { WorkflowRunnerModal } from "./components/WorkflowRunnerModal"; import { ConfirmDialog } from "./components/ConfirmDialog"; +import { CopyableUrl } from "./components/CopyableUrl"; import { parseBarcodeInput } from "./utils/barcodeScanner"; import { exportToCsv } from "./utils/exportCsv"; import { matchFilter } from "./utils/searchSyntax"; @@ -1694,9 +1695,27 @@ export default function App() { isOpen={lanPending !== null} title={lanPending ? "Enable LAN access?" : "Restrict to this machine?"} message={ - lanPending - ? `ProFiles will be reachable by anyone on this network:\nhttp://${systemInfo?.hostname}:${window.location.port}\nhttp://${systemInfo?.ip}:${window.location.port}` - : "ProFiles will be reachable only on this machine." + lanPending ? ( + + ProFiles will be reachable by anyone on this network: + showToast("URL copied to clipboard.")} + onCopyError={() => showToast("Failed to copy URL.", "error")} + /> + showToast("URL copied to clipboard.")} + onCopyError={() => showToast("Failed to copy URL.", "error")} + /> + + ) : ( + "ProFiles will be reachable only on this machine." + ) } confirmLabel={lanPending ? "Enable LAN" : "Restrict"} onConfirm={async () => { diff --git a/src/profiles/web/src/components/ConfirmDialog.tsx b/src/profiles/web/src/components/ConfirmDialog.tsx index c394599..eef7d9e 100644 --- a/src/profiles/web/src/components/ConfirmDialog.tsx +++ b/src/profiles/web/src/components/ConfirmDialog.tsx @@ -1,4 +1,5 @@ import { useRef } from "react"; +import type { ReactNode } from "react"; import { AlertTriangle } from "lucide-react"; import { useModalA11y } from "../utils/useModalA11y"; @@ -6,8 +7,8 @@ import { useModalA11y } from "../utils/useModalA11y"; interface ConfirmDialogProps { isOpen: boolean; title: string; - /** Body text; `\n` renders as a line break. */ - message: string; + /** Body content; a plain string renders `\n` as a line break. */ + message: ReactNode; confirmLabel?: string; cancelLabel?: string; /** When true the confirm button uses the danger styling. */ @@ -71,7 +72,9 @@ export function ConfirmDialog({ {title} -

{message}

+
+ {message} +
+ + ); +} diff --git a/src/profiles/web/tsconfig.tsbuildinfo b/src/profiles/web/tsconfig.tsbuildinfo index ddf4c49..42e771f 100644 --- a/src/profiles/web/tsconfig.tsbuildinfo +++ b/src/profiles/web/tsconfig.tsbuildinfo @@ -1 +1 @@ -{"root":["./src/app.tsx","./src/main.tsx","./src/setup-tests.ts","./src/vite-env.d.ts","./src/vitest.d.ts","./src/api/client.test.ts","./src/api/client.ts","./src/api/types.ts","./src/components/actionbar.tsx","./src/components/barcodemodal.tsx","./src/components/camerabarcodemodal.tsx","./src/components/confirmdialog.tsx","./src/components/contextmenu.tsx","./src/components/directorypickermodal.tsx","./src/components/dropconfigoverlay.tsx","./src/components/editablecombobox.tsx","./src/components/errorboundary.tsx","./src/components/filelisttable.tsx","./src/components/filepropertiesmodal.tsx","./src/components/filtersyntaxhelper.tsx","./src/components/headerbar.tsx","./src/components/initerrorpanel.tsx","./src/components/loadconfigmodal.tsx","./src/components/logviewermodal.tsx","./src/components/markdownmessage.test.tsx","./src/components/markdownmessage.tsx","./src/components/scanstatusstrip.tsx","./src/components/searchbar.tsx","./src/components/shortcutsmodal.tsx","./src/components/singlematchpromptmodal.tsx","./src/components/statusbar.test.tsx","./src/components/statusbar.tsx","./src/components/timermodal.tsx","./src/components/tooltip.tsx","./src/components/workflowrunnermodal.test.tsx","./src/components/workflowrunnermodal.tsx","./src/utils/barcodedecoder.test.ts","./src/utils/barcodedecoder.ts","./src/utils/barcodescanner.ts","./src/utils/configdrop.test.ts","./src/utils/configdrop.ts","./src/utils/exportcsv.ts","./src/utils/fileproperties.test.ts","./src/utils/fileproperties.ts","./src/utils/searchsyntax.test.ts","./src/utils/searchsyntax.ts","./src/utils/theme.test.ts","./src/utils/theme.ts","./src/utils/usemodala11y.test.tsx","./src/utils/usemodala11y.ts"],"version":"5.7.3"} \ No newline at end of file +{"root":["./src/app.tsx","./src/main.tsx","./src/setup-tests.ts","./src/vite-env.d.ts","./src/vitest.d.ts","./src/api/client.test.ts","./src/api/client.ts","./src/api/types.ts","./src/components/actionbar.tsx","./src/components/barcodemodal.tsx","./src/components/camerabarcodemodal.tsx","./src/components/confirmdialog.tsx","./src/components/contextmenu.tsx","./src/components/copyableurl.test.tsx","./src/components/copyableurl.tsx","./src/components/directorypickermodal.tsx","./src/components/dropconfigoverlay.tsx","./src/components/editablecombobox.tsx","./src/components/errorboundary.tsx","./src/components/filelisttable.tsx","./src/components/filepropertiesmodal.tsx","./src/components/filtersyntaxhelper.tsx","./src/components/headerbar.tsx","./src/components/initerrorpanel.tsx","./src/components/loadconfigmodal.tsx","./src/components/logviewermodal.tsx","./src/components/markdownmessage.test.tsx","./src/components/markdownmessage.tsx","./src/components/scanstatusstrip.tsx","./src/components/searchbar.tsx","./src/components/shortcutsmodal.tsx","./src/components/singlematchpromptmodal.tsx","./src/components/statusbar.test.tsx","./src/components/statusbar.tsx","./src/components/timermodal.tsx","./src/components/tooltip.tsx","./src/components/workflowrunnermodal.test.tsx","./src/components/workflowrunnermodal.tsx","./src/utils/barcodedecoder.test.ts","./src/utils/barcodedecoder.ts","./src/utils/barcodescanner.ts","./src/utils/configdrop.test.ts","./src/utils/configdrop.ts","./src/utils/exportcsv.ts","./src/utils/fileproperties.test.ts","./src/utils/fileproperties.ts","./src/utils/searchsyntax.test.ts","./src/utils/searchsyntax.ts","./src/utils/theme.test.ts","./src/utils/theme.ts","./src/utils/usemodala11y.test.tsx","./src/utils/usemodala11y.ts"],"version":"5.7.3"} \ No newline at end of file